View endler-register-custom-view-tpl.php
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 | |
/** | |
* Implements hook_theme(). | |
* | |
* Drupal 7 view template-ing from a module. | |
* | |
* @author Justin Endler | |
*/ | |
function mymodule_theme($existing, $type, $theme, $path) { | |
$module_path = drupal_get_path('module', 'mymodule'); |
View endler-d7-feature-branch.sh
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 | |
# | |
# Sets up a local Drupal 7 environment for working on a feature branch. | |
# | |
# @author Justin Endler | |
# | |
defaultsettings="http://drupalcode.org/project/drupal.git/blob_plain/HEAD:/sites/default/default.settings.php" | |
echo -e "\nThis script is D7-specific." |
View endler-d7-feature-review.sh
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 | |
# | |
# Sets up a local Drupal 7 branch review and attempts a merge with a forked-from repo. | |
# | |
# @author Justin Endler | |
# | |
defaultsettings="http://drupalcode.org/project/drupal.git/blob_plain/HEAD:/sites/default/default.settings.php" | |
echo -e "\nThis script is D7-specific." |
View endler-trim-backups.sh
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 | |
# | |
# Trim total files to maxbackups amount. | |
# | |
# Cron: | |
# http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/ | |
# | |
# @author Justin Endler | |
# |
View regular-expressions-tool-link.txt
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
http://gskinner.com/RegExr/ | |
http://superuser.com/questions/350511/changing-colors-of-linux-command-line-mode | |
ps -eLf | |
awk -F":" '{ print "username: " $1 "\t\tuid:" $3 }' /etc/passwd (http://www.linuxquestions.org/linux/answers/Networking/How_to_list_all_your_USERs) | |
http://jsonlint.com/ | |
http://www.howtogeek.com/50853/find-the-php-ini-file-location-from-the-command-line/ |
View endler-migrate-field-data.php
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) { |
View storeUtil.js
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) { |
View console_info.sublime-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[ | |
console.info('${1:thing}:', ${1}); // @test | |
]]></content> | |
<tabTrigger>info</tabTrigger> | |
<description>console.info()</description> | |
<scope>source.js</scope> | |
</snippet> |
View heroku-deploy.sh
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 |
OlderNewer