In this example I define two custom function.
1 - countryFilter function get's the country short code as input and return the country full name.
2 - _countPrinterTasks is used to calculate the no of tasks assigned to a particular user.
<?php
namespace DashboardBundle\Twig\Extension;
use ...
Visual Studio (IDE)
WPA (performance analyzer)
WinDbg (debugger)
IDA Pro (disassembler)
dotPeek (decompiler for .NET)
WinMerge (diff tool)
HxD or 010 editor (hex editor)
Speedcrunch (calculator)
Firefox (browser)
Rohitab API monitor (API call monitoring)
SOS (a WinDbg extension for .NET)...
Use the annotation @FixMethodOrder with the method sorter MethodSorters.NAME_ASCENDING. This will run all tests within the class in a deterministic and predictable order. The implementation compares the method names and in the case of a tie, it compares the methods' toString().
Code Segment Below T...
While each mobile platforms do offer their own settings management api, there are no built in ways to read settings from a good old .net style app.config xml file;
This is due to a bunch of good reasons, notably the .net framework configuration management api being on the heavyweight side, and each...
Express passes a next callback to every route handler and middleware function that can be used to break logic for single routes across multiple handlers. Calling next() with no arguments tells express to continue to the next matching middleware or route handler. Calling next(err) with an error will ...
In addition to prebuilt grid classes for fast layouts, Bootstrap includes Less variables and mixins for quickly generating your own simple, semantic layouts.
Variables
Variables determine the number of columns, the gutter width, and the media query point at which to begin floating columns. We use ...
The following is a simple example Perl test script, that gives some structure to allow for testing of other methods in the class/package under test.
The script produces standard output with simple "ok" / "not ok" text, which is called TAP (Test Anything Protocol).
Typically the...
If your code is running behind a proxy and you know the end point, you can set this information in your code.
requests accepts a proxies parameter. This should be a dictionary that maps protocol to the proxy URL.
proxies = {
'http': 'http://proxy.example.com:8080',
'https': 'http://securepro...
requests uses specific environment variables automatically for proxy detection.
HTTP_PROXY will define the proxy URL to use for HTTP connections
HTTPS_PROXY will define the proxy URL to use for HTTPS connections
Once these environment variables are set, the Python code does not need to pass a...
Xcode by itself has quite a few good tools built in, but sometimes you just want to change a specific behavior or create a convenience shortcut.
That's why there's Alcatraz.
Installation
curl -fsSL https://raw.githubusercontent.com/supermarin/Alcatraz/deploy/Scripts/install.sh | sh
Throw this ...
Open phone's settings
open battery
open menu and select "battery optimization"
from the dropdown menu select "all apps"
select the app you want to whitelist
select "don't optimize"
Now this app will show under not optimized apps.
An app can check whether it's...
Elixir / Phoenix
Install Homebrew first:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then running brew install elixir will install both Elixir and it's dependency - Erlang.
Install mix with mix local.hex.
Install Phoenix as per ...
Writing and executing a simple TestNG program is mainly 3 step process.
Code - write business logic of your test and annotate it with TestNG annotations
Configure - add information of your test in testng.xml or in build.xml
Run TestNG - it can be invoked from command line, ANT, IDE like Eclipse...
To send an event: vm.$emit('new-message');
To catch an event: vm.$on('new-message');
To send an event to all components down: vm.$broadcast('new-message');
To send an event to all components up: vm.$dispatch('new-message');
Note: $broadcast and $dispatch are deprecated in Vue2. (see Vue2 feature...
This code places the hint text at form load and manipulates it as follows:
C#
private void Form_load(object sender, EventArgs e)
{
textBox.Text = "Place Holder text...";
}
private void textBox_Enter(object sender, EventArgs e)
{
if(textBox.Text == "Place Holder text....
<?php
// hook into the init action and call create_book_taxonomies when it fires
add_action( 'init', 'create_book_taxonomies', 0 );
// create taxonomy genres for the post type "book"
function create_book_taxonomies() {
// Add new taxonomy, make it hierarchical (like categorie...
Given:
---
variable_name: True
Then, these tasks with always run.
- name: This is a conditional task
module: src=/example/ dest=/example
when: variable_name
- name: This is a conditional task
module: src=/example/ dest=/example
when: True
This task will never run.
- name: T...
Real life use cases for Singleton pattern;
If you are developing a client-server application, you need single instrance of ConnectionManager, which manages the life cycle of client connections.
The basic APIs in ConnectionManager :
registerConnection: Add new connection to existing list of connec...