This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
NSString *const retirementUrl = @"https://query.yahooapis.com/v1/public/yql/homerj/retirement?format=json"; | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
// insert code here... | |
NSURLSession *session = [NSURLSession sharedSession]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint white:true */ | |
/*global console */ | |
function lastFridayOfMonth(year, month) { "use strict"; | |
var lastDay = new Date(year, month+1, 0); | |
if(lastDay.getDay() < 5) { | |
lastDay.setDate(lastDay.getDate() - 7); | |
} | |
lastDay.setDate(lastDay.getDate() - (lastDay.getDay() -5)); | |
return lastDay; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint plusplus:true, white:true */ | |
/*global console:false */ | |
function secondMonday(year, month) { "use strict"; | |
var firstDay = new Date(year, month, 1); | |
if(firstDay.getDay() !== 1) { | |
firstDay.setDate( | |
firstDay.getDay() === 0 ? 2 : 9 - firstDay.getDay() | |
); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# listBBRepos.sh [bitbucket username] | |
curl -su "$1" https://api.bitbucket.org/1.0/users/"$1" | perl -MJSON -MData::Dumper -ne' | |
my $data = from_json($_); | |
foreach my $repo (@{$data->{repositories}}) { | |
print $repo->{slug}, "\n"; | |
}' |
NewerOlder