Skip to content

Instantly share code, notes, and snippets.

View ssoper's full-sized avatar
👨‍💻

Sean Soper ssoper

👨‍💻
View GitHub Profile
@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 / 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 / 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 / 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 / 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
$().ready(function() {
// init file upload
var uploadTimer;
var doUpload=$('#upload1').upload({
name: 'file',
method: 'post',
enctype: 'multipart/form-data',
action: '<c:url value="ParseResumeDocumentServlet"/>',
params: {
editorFlag: ""
@ssoper
ssoper / gist:23509
Created November 10, 2008 15:44
Recipe for gluten-free pancakes
1 cup gluten-free whole wheat (i recommend Bob's Red Mill)
2 tsp baking powder
1 tsp salt
1/3 cup shortening
1/4 cup sugar
2 bananas
1/2 tsp lemon extract (or some lemon zest will do)
throw it in your kitchenaid for a few minutes, put it in a greased 8.5" dish, 350F for 55 mins.
@ssoper
ssoper / gist:23866
Created November 11, 2008 14:47
The ghost class! ...spooky
irb(main):001:0> class Foo
irb(main):002:1> def ghost_class
irb(main):003:2> class << self
irb(main):004:3> self
irb(main):005:3> end
irb(main):006:2> end
irb(main):007:1> end
=> nil
irb(main):008:0> bar = Foo.new
@ssoper
ssoper / gist:23867
Created November 11, 2008 14:47
ghost class
irb(main):001:0> class Foo
irb(main):002:1> def ghost_class
irb(main):003:2> class << self
irb(main):004:3> self
irb(main):005:3> end
irb(main):006:2> end
irb(main):007:1> end
=> nil
irb(main):008:0> bar = Foo.new
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script>
</head>
<body>
<form method="post" action="/taggings/condition">
<div style="margin: 0pt; padding: 0pt;"><input type="hidden" value="put" name="_method"/><input type="hidden" value="0ba2a152cfbbec1054f94333b533d7d79753e635" name="authenticity_token"/></div>
<input type="hidden" value="business_type" name="tagging[on]" id="tagging_on"/>
<select name="tagging[list][]" id="tagging_list" style="display: none;" multiple=""><option selected="selected" value="acne">acne</option>
<option selected="selected" value="vitiligo">vitiligo</option><option value="cancer - bladder" selected="selected">cancer - bladder</option></select><ul class="holder"><li class="bit-box" rel="acne">acne<a class="closebutton" href="#"/></li><li class="bit-box" rel="vitiligo">vitiligo<a class="closebutton" href="#"/></li><li class="bit-box" rel="cancer - bladder">cancer - bladder<a class="closebutton" href="#"/></li><li class=