Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jazzychad on github.
  • I am jazzychad (https://keybase.io/jazzychad) on keybase.
  • I have a public key whose fingerprint is 985B C9D2 1466 2E73 C27D 9792 4D0C FB63 C09D 814E

To claim this, I am signing this object:

@jazzychad
jazzychad / gist:1aef114dcc0a67592630
Created June 18, 2014 07:10
slingshot post data
{
"data": {
"caption": "Sniffing traffic",
"captionYPosition": 0.8010632,
"capturedAt": {
{
"title": "My iOS Indie-Game Numbers",
"timestamp": "2014-07-29T17:35:23.000Z",
"visbility": "public"
}
@jazzychad
jazzychad / mainqueue.c
Created July 29, 2014 23:21
mainqueue.c
// in some .h file
extern void runOnMainQueue(dispatch_block_t block);
extern void asyncRunOnMainQueue(dispatch_block_t block);
// in some .m file
void runOnMainQueue(dispatch_block_t block)
{
@jazzychad
jazzychad / notes.sh
Last active August 29, 2015 14:04
user input prompt
# if you want to capture some kind of user input during a script (e.g. Xcode Run Script Phase) you can use this neato trick
#
# it will give up after 20 seconds of no input and return an empty string, in the case you you hit Build and just walk away
#
# note: only works on macs b/c it uses AppleScript
echo -n $(osascript -e 'set notes to the text returned of (display dialog "Build Notes" default answer "" buttons {"OK"} giving up after 20)')
# e.g.
BUILD_NOTES=`echo -n $(osascript -e 'set notes to the text returned of (display dialog "Build Notes" default answer "" buttons {"OK"} giving up after 20)')`
@jazzychad
jazzychad / metadata.json
Created August 2, 2014 18:36
Hello World
{
"title": "Hello World",
"visbility": "public",
"visibility": "public"
}
{
"title": "Second!",
"visbility": "public",
"visibility": "public"
}
@jazzychad
jazzychad / metadata.json
Last active October 4, 2015 13:41
Announcing gistbits!
{
"title": "Announcing gistbits!",
"visbility": "public",
"visibility": "public"
}
@jazzychad
jazzychad / metadata.json
Created August 3, 2014 18:35
This is a Post
{
"title": "This is a Post",
"visbility": "public",
"visibility": "public"
}
@jazzychad
jazzychad / propertynotif_snippet.m
Last active August 29, 2015 14:05
Set property with notification observation
- (void)set<#Property#>:(<#class#> *)<#parameter#>
{
if (<#ivar#> != <#parameter#>) {
if (<#ivar#>) {
[[NSNotificationCenter defaultCenter] removeObserver:self name:<#(NSString *)#> object:<#(ivar)#>];
}
<#ivar#> = <#parameter#>;
if (<#ivar#>) {