Skip to content

Instantly share code, notes, and snippets.

View ssoper's full-sized avatar
👨‍💻

Sean Soper ssoper

👨‍💻
View GitHub Profile
@ssoper
ssoper / word_count.sh
Created March 23, 2015 16:24
Recursive word count
#!/usr/bin/env bash
grep '' -IR . | wc -w
@ssoper
ssoper / remove_blank_lines
Created December 8, 2014 13:33
Remove blank lines from a file that start with empty space. Fairly common with Xcode files.
sed -i '' 's/^ *$//g' $1
@ssoper
ssoper / podclean
Last active August 29, 2015 14:10
Clean the current project
rm -rf Pods && rm -rf Podfile.lock && rm -rf ~/Library/Developer/Xcode/DerivedData/* && pod install && find . -name '*.xcworkspace' | tail -1 | xargs open
@ssoper
ssoper / veal pie recipe.md
Last active August 29, 2015 14:09
Veal Heart Pie

Veal Heart Pie

Ingredients

  1. 4 tbsp. butter
  2. 1-2 lbs of veal heart
  3. 6-12 dried figs
  4. 1 medium yellow onion
  5. 1 tbsp garlic crushed
  6. 3 14 oz. cans of chicken stock
  7. 2 bay leaves
@ssoper
ssoper / retag
Created November 11, 2014 00:57
Quickly retag your current work, useful for working with CocoaPods
TAG=`git tag | tail -n 1`
git tag -d $TAG
git push origin :$TAG 2>/dev/null || echo "Tag was local, nothing remote to delete"
git tag -a $TAG -m "$TAG" && git push origin $TAG
@ssoper
ssoper / gist:6972710ea322e5153277
Last active August 29, 2015 14:05
Using NSUserDefaults to log background pushes, useful for debugging newsstand
#define NSDLOG(fmt, ...) if (![[NSUserDefaults standardUserDefaults] valueForKey: @"LOG"]) { \
[[NSUserDefaults standardUserDefaults] setValue: @"" forKey: @"LOG"]; \
[[NSUserDefaults standardUserDefaults] synchronize]; \
} \
[[NSUserDefaults standardUserDefaults] setValue: [[[NSUserDefaults standardUserDefaults] valueForKey: @"LOG"] stringByAppendingFormat: [@"\n" stringByAppendingString: fmt], ##__VA_ARGS__] forKeyPath: @"LOG"]; \
[[NSUserDefaults standardUserDefaults] synchronize];
@ssoper
ssoper / gist:5606026
Last active December 17, 2015 11:59
Durian Strawberry Pie

For the strawberry

  1. 5-10 strawberries
  2. ¾ cup sugar

Coat the strawberries throughly with the sugar and cook down on high heat while stirring constantly and mashing into a pulp.

For the durian

  1. Guts of 1 durian
  2. 1½ cup heavy whipping cream
  3. 4 eggs
@ssoper
ssoper / schema.js
Created December 17, 2012 14:09
Create per-model chain methods in Mongoose
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId,
Query = mongoose.Query,
merge = require('node_modules/mongoose/lib/utils').merge
Query.prototype.valid = function(criteria, cb) {
if (this.model.modelName !== 'Comment')
throw new TypeError('Can only use with the Comment model');
@ssoper
ssoper / .ackrc
Created December 12, 2012 19:11
My .ackrc file, useful for node projects that make use of npm and jscoverage
--ignore-dir=lib-cov
--ignore-dir=node_modules
--invert-file-match
-G(coverage\.html)
@ssoper
ssoper / gist:4087385
Created November 16, 2012 13:32
Kale chips
1/2 lb kale
2 tbsp honey
2 tbsp sriracha
1 tbsp salt
mix all together, spread in a thin layer on a cookie sheet
cook at 300°F for 30 minutes
measurements are approximate, adjust to taste