These rules are adopted from the AngularJS commit conventions.
#!/bin/bash | |
# Usage: | |
# $ bash import-dump.sh http://example.co.uk/dump.sql.gz | |
start=$(date +"%s") | |
echo "-> Deleting of old tables" | |
mysql --user=root -e 'DROP DATABASE wikijob;' |
static int8_t t = 0; | |
void setup() { | |
// Initialize serial communication at 57600 bits per second: | |
Serial.begin(57600); | |
Bean.setLed(0, 0, 0); | |
} | |
void setLed(int8_t t, int fadeValue) { | |
if (t > 22) { // If greater than 22C, set LED to Red. |
<?php | |
function _date_range($first, $last, $step = '+1 day', $format = 'Y-m-d') { | |
$dates = array(); | |
$current = strtotime($first); | |
$last = strtotime($last); | |
while ($current <= $last) { | |
$dates[] = date($format, $current); | |
$current = strtotime($step, $current); |
<?php | |
// SELECT One field: SELECT title FROM {node} WHERE nid = 123 | |
$title = db_select('node', 'n') | |
->fields('n', array('title')) | |
->condition('n.nid', 123) | |
->execute() | |
->fetchField(); | |
// SELECT One object: SELECT title FROM {node} WHERE nid = 123 |
CORS (cross origin resource sharing) is a mechanism to allow client web applications make HTTP requests to other domains. For example if you load a site from http://domainA.com and want to make a request (via xhr or img src, etc) to http://domainB.com without using CORS your web browser will try to protect you by blocking the response from the other server. This is because browsers restrict responses coming from other domains via the Same-Origin-Policy.
CORS allows the browser to use reponses from other domains. This is done by including a Access-Control
headers in the server responses telling the browser that requests it is making is OK and safe to use the response.
Header | Description |
---|---|
Access-Control-Allow-Origin: |
Allow requests from `` to access t |
<?php | |
//@see: https://drupal.org/node/1021556 | |
$wrapper = entity_metadata_wrapper('node', $node); | |
$wrapper->author->mail->value(); | |
$wrapper->author->mail->set('[email protected]'); | |
$wrapper->author->mail = '[email protected]'; | |
// Unified way of getting $node->title, $user->name, ... |
Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
- XCode is installed (via the App Store)
- XCode command line tools are installed (
xcode-select --install
will prompt up a dialog) - Java
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
function asynkFunction(){ | |
return $timeout(function meAsynk(){ | |
throw new Error('error in meAsynk'); | |
}, 1); | |
} | |
asynkFunction().catch(function (err) { | |
errorHandler(err); | |
}); |
form i.icon.error { | |
color: $assertive; | |
} | |
form input + i.icon.error { | |
display: none; | |
margin-left: 8px; | |
} | |
form.ng-submitted input.ng-invalid + i.icon.error { |