Skip to content

Instantly share code, notes, and snippets.

@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];
@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: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 / 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: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 / letsfreckle-tags.js
Created July 23, 2012 16:42 — forked from anonymous/letsfreckle-tags.js
LetsFreckle tag performance fix
// ==UserScript==
// @name LetsFreckle Tags
// @namespace http://www.lullabot.com/
// @version 0.1
// @description Reduce the number of tags to fix performance issues.
// @match https://*.letsfreckle.com/*
// @copyright 2012+, Andrew Berry, [email protected]
// ==/UserScript==
@brockboland
brockboland / gist:3094686
Created July 12, 2012 00:27
Simple "Tweet this page" bookmarklet Javascript
javascript: var D=550, A=450, C=screen.height, B=screen.width, H=Math.round((B/2)-(D/2)), G=0, F=document, t=encodeURIComponent(F.title), u=encodeURIComponent(F.location); if(C>A) {G=Math.round((C/2)-(A/2));} window.open('http://twitter.com/intent/tweet?text=' + t + '&url=' + u,'','left='+H+',top='+G+',width='+D+',height='+A+',personalbar=0,toolbar=0,scrollbars=1,resizable=1');
diff --git a/feeds_xpathparser.module b/feeds_xpathparser.module
index bb583ed..aca2470 100644 (file)
--- a/feeds_xpathparser.module
+++ b/feeds_xpathparser.module
@@ -10,7 +10,8 @@ function feeds_xpathparser_feeds_plugins() {
'description' => t('Parse HTML using XPath.'),
'handler' => array(
'parent' => 'FeedsParser',
@brockboland
brockboland / gist:1658632
Created January 22, 2012 20:19
TextExpander snippet to load https://gist.github.com/1633790
#!/usr/bin/php
<?php
// Make sure to set the Content dropdown to Shell Script in TextExpander
print file_get_contents('https://raw.github.com/gist/1633790/local.settings.php');