View endler-register-custom-view-tpl.php
<?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
#!/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
#!/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-wordpress-render-media-button.php
<?php
/**
* This assumes you'll be plugging in to media-upload.php in order to upload a file.
*
* @author Justin Endler
*/
// Get WordPress version.
$version = get_bloginfo('version');
View endler-trim-backups.sh
#!/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
View endler-migrate-field-data.php
<?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
(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
<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
#!/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