Skip to content

Instantly share code, notes, and snippets.

Payton White prwhite

Block or report user

Report or block prwhite

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
prwhite / gist:1250016
Created Sep 29, 2011
Complete Makefile targets in tcsh
View gist:1250016
# first grep finds lines with potential commands
# second grep throws away pure comment lines
# then sed throws away anything after initial target name (which should just be the : now)
# final uniq throws away dups
# could be more optimal :)
# could probably do something to generate completes from -f makefile name
alias makeCommands 'echo `egrep --only-matching "^.*?: " Makefile | egrep -v "^[[:space:]]*#" | sed "s/\(:.*\)//" | uniq`'
complete make 'n/*/`makeCommands`/'
prwhite / NSJSONSerialization+jsonXpath.m
Created Jan 20, 2013
For primitive xpath-like functionality built on Apple's NSJSONSerialization. Based on this: But, it adds the ability to find non-leaf nodes, and it tacks onto NSJSONSerialization as a category.
View NSJSONSerialization+jsonXpath.m
@implementation NSJSONSerialization (jsonXpath)
+ (NSObject *)objectForPath:(NSString *)jsonXPath container: (NSObject*) currentNode
if (currentNode == nil) {
return nil;
// we cannot go any further
if(![currentNode isKindOfClass:[NSDictionary class]] && ![currentNode isKindOfClass:[NSArray class]]) {
prwhite / gist:5846493
Created Jun 23, 2013
Q&D node.js script to pull out any Google Reader items tagged with a public label, e.g., "starred".
View gist:5846493
#!/usr/bin/env node --harmony
"use strict";
var req = require ( "request" );
var fs = require ( "fs" );
# replace these... could be command line args but that would have taken like 15 seconds more.
var userid = "06674516782868565233";
var label = "starred";
prwhite /
Last active Dec 31, 2015
Script for copying header files in an Xcode library/framework project while retaining their hierarchical structure. This requires creating a headers-bom file listing relative paths to the headers to be copied. Using rsync makes things relatively painless and potentially even more efficient than other methods.
echo PWD = ${PWD}
# just to be sure
# using . as source below might not be what you want... feel free to change, etc.
prwhite / Makefile
Last active Feb 17, 2020
Add a help target to a Makefile that will allow all targets to be self documenting
View Makefile
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
prwhite / gist:b95fe6154bd3d559eff2
Created Mar 25, 2015
Simple ObjC augmentation for NSLog to add file, line number and pretty function name. Compiles out in release (assuming DEBUG is not set in release)
View gist:b95fe6154bd3d559eff2
#ifdef DEBUG
#define NSLogDebug(format, ...) \
NSLog(@"<%s:%d> %s, " format, \
strrchr("/" __FILE__, '/') + 1, __LINE__, __PRETTY_FUNCTION__, ## __VA_ARGS__)
#define NSLogDebug(format, ...)
prwhite / feedly-tag-dropdown-shortcut.user.js
Last active Dec 28, 2017
Add keyboard shortcut ('t') to show the tag list dropdown for the active [floating] entry.
View feedly-tag-dropdown-shortcut.user.js
// ==UserScript==
// @name Feedly Open Tags Dropdown
// @namespace
// @version 0.9.14
// @description Show the Feedly tag entry dropdown with a keyboard shortcut. This functionality should be builtin!
// @author Payton R White
// @include*
// @include*
// @include http://**
// @include https://**
prwhite / feedly-colorful-list-view.user.js
Last active Dec 28, 2017 — forked from yamalight/feedly-colorful-list-view.user.js
Feedly Colorful Listview [more subtle colors]
View feedly-colorful-list-view.user.js
// ==UserScript==
// @name Feedly Colorful Listview
// @namespace http://feedly.colorful.list.view
// @description Colorizes items headers based on their source
// @include http*://*
// @include http*://**
// @version 0.8.9
// @grant GM_addStyle
// ==/UserScript==
You can’t perform that action at this time.