Skip to content

Instantly share code, notes, and snippets.

@brockboland
brockboland / gist:3723311
Created September 14, 2012 17:14
Drush/Features shenanigans
$ drush fra -y
Command fra needs the following module(s) enabled to run: features. The drush command 'fra' could not be executed.
$ drush en features -y
features is already enabled. There were no extensions that could be enabled.
@brockboland
brockboland / nodequeue_create.php
Created September 21, 2012 18:13
Drupal: Create a nodequeue if it doesn't exist already
drupal_load('module', 'nodequeue');
// Homepage Features
$queue = nodequeue_load_queue_by_name('homepage_features');
if (empty($queue)) {
$queue = new stdClass();
$queue->title = 'Homepage Features';
$queue->name = 'homepage_features';
$queue->size = 4;
$queue->owner = 'nodequeue';
@brockboland
brockboland / gist:4017640
Created November 5, 2012 15:05
Combine month and year dropdowns for Views date filter
/**
* Implements hook_date_select_process_alter().
* Alter the month/year dropdown filter for views to use a single dropdown
* instead of using separate year and month dropdowns.
*
* This is ONLY done on elements where #combine_dropdowns is TRUE on the
* element. This is to prevent the process from being used on form elements
* where it is not intended. Use form_alter to set #combine_dropdowns on form
* elements that should use the combined dropdown.
*
@brockboland
brockboland / gist:5592542
Created May 16, 2013 15:25
Drush command to load Views string translations into Built-in Interface strings that have the same source text, but lack translations.
<?php
/**
* @file
* Drush command to load the translations from Views translated strings into
* Built-in Interface counterparts
*/
/**
* Implements hook_drush_command().
@brockboland
brockboland / gist:5843523
Last active December 18, 2015 20:58
I finally figured out how to include another view at the top of a UITableViewController. I think this will be necessary (or at least helpful) to mimic the Contact edit view in the Contacts app.
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// Replace "HeaderSubViewNibName" with the actual name of the xib file to load
// your header view.
// This returns an array, hence the objectAtIndex: to get the first (and only)
// item in the array.
UIView *headerView = [[[NSBundle mainBundle] loadNibNamed:@"HeaderSubViewNibName" owner:self options:nil] objectAtIndex:0];
-(void) initStringValue: (NSString *) newValue {
myString = newValue;
}
-(void) changeStringValue: (NSString *) newValue {
// Something needs to change here
myString = newValue;
}
MyClass * objA = [[MyClass alloc] init];
@brockboland
brockboland / gist:7269148
Created November 1, 2013 17:51
I'm not good at remembering long commands, so my .bash_profile is littered with things like this. This one converts a movie file into a gif. See https://gist.github.com/dergachev/4627207 for details.
# Convert a movie file to a gif. Crappy quality, only good for short screen cap
# See https://gist.github.com/dergachev/4627207
function gifify {
if [ -z "$1" ]
then
# No parameter passed, show usage
echo "Usage: gifify filename.mov"
echo "Resulting gif is stored as out.gif"
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
@brockboland
brockboland / gist:7361176
Created November 7, 2013 20:19
Places to change your name if you legally change it
  • Social Security Card
  • Passport
  • Driver's license
  • Life insurance
  • Health insurance
  • Dental insurance
  • Renter's Insurance
  • HR at work
  • Checking/savings account
  • Order new checks
@brockboland
brockboland / gist:8921355
Created February 10, 2014 18:22
Better video-to-gif
# Convert a movie file to a gif. Better quality!
# The output file is the original file with .gif tacked on
# See http://superuser.com/a/556031/1090
function goodgif {
if [ -z "$1" ]
then
# No parameter passed, show usage
echo "Usage: goodgif filename.mov"
echo "Resulting gif is stored as out.gif"
else