This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file endler-migrate-field-data.php | |
* | |
* Drush script to migrate some string from one set of node fields to another. | |
* | |
* @author Justin Endler | |
*/ | |
function update_node_fields($entity_id, $value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
Drupal.behaviors.storeUtil = { | |
/** | |
* @param Number negative places to move the decimal left, positive to move it right | |
* @param String float | |
* @return String | |
*/ | |
moveDecimal: function(places, f) { | |
// Move zero places. | |
if (!places) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
console.info('${1:thing}:', ${1}); // @test | |
]]></content> | |
<tabTrigger>info</tabTrigger> | |
<description>console.info()</description> | |
<scope>source.js</scope> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# requires that node app.js be contained in a Procfile | |
# ./heroku-deploy.sh <NODE_ENV> <local_branch_to_push> <app_to_destroy_if_redeploy> | |
# validate minimal input | |
if [ -z "$1" ] || [ -z "$2" ]; then | |
echo "Run with at least NODE_ENV and local_branch_to_push as arguments $1 and $2" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
// @todo | |
]]></content> | |
<tabTrigger>todo</tabTrigger> | |
<description>@todo</description> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
// @test | |
]]></content> | |
<tabTrigger>test</tabTrigger> | |
<description>@test</description> | |
</snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -n "$(git rev-parse --abbrev-ref HEAD)" | pbcopy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// support multiple browsers | |
// http://stackoverflow.com/questions/2844565/is-there-a-jquery-dom-change-listener/11546242#11546242 | |
MutationObserver = window.MutationObserver || window.WebKitMutationObserver; | |
var elementId = 'some-id'; | |
// instantiate initial observer | |
var observer = new MutationObserver(observeIndefinitely(elementId)); | |
observer.observe(document.getElementById(elementId), { | |
// expensive, only use what's needed of these | |
attributes: true, | |
childList: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// not for production use | |
function MobileWidthHelpers () { | |
this.stringName = stringName; | |
var ignoreElements = [ | |
'SCRIPT', | |
'LINK', | |
'META' | |
]; | |
function stringName ($el) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const file = 'some_file.js'; | |
const ignore = [ | |
'a', | |
'input', | |
'span', | |
'td', | |
'title', |