This file contains 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 "RKTest.h" | |
#import <RestKit.h> | |
#import <Nocilla.h> | |
NSString * const kBaseURL = @"http://www.foo.com"; | |
static AFHTTPClient *client = nil; | |
@interface Foo : NSObject | |
@property (nonatomic, strong) NSString *value; |
This file contains 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
City | latitude | Country | rank | population | longitude | |
---|---|---|---|---|---|---|
Tokyo | 35.670479 | Japan | 1 | 28,025,000 | 139.740921 | |
Mexico City | 19.32792 | Mexico | 2 | 18,131,000 | -99.19109 | |
Mumbai | 19.11105 | India | 3 | 18,042,000 | 72.87093 | |
S·o Paulo | 0.3617 | Brazil | 4 | 17, 711,000 | -52.147511 | |
New York City | 40.71455 | USA | 5 | 16,626,000 | -74.7124 | |
Shanghai | 31.247709 | China | 6 | 14,173,000 | 121.472618 | |
Lagos | 6.43918 | Nigeria | 7 | 13,488,000 | 3.42348 | |
Los Angeles | 34.5329 | USA | 8 | 13,129,000 | -118.245009 | |
Calcutta | 22.52667 | India | 9 | 12,900,000 | 88.34616 |
This file contains 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
public interface CoalescingCallback<U> { | |
U call(); | |
} | |
/*** | |
* See documentation for coalesce(CoalescingCallback<T>, T) | |
*/ |
This file contains 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/sh | |
# This script is made to run inside a docker container, when we need to watch for changes in the container and build. | |
# Initially used for watching changes and doing a Hugo build, but this should be pretty general purpose. | |
# We simply calculate the md5sum of the entire directory every second, and trigger the build command if something has changed | |
PREV_VALUE="" | |
while : | |
do | |
VALUE=`tar --exclude="dir/to/exclude" --exclude="anotherdir/to/exclude" -cf - . | md5sum` |
This file contains 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
{ | |
"name": "server", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"dependencies": {}, | |
"devDependencies": { | |
"autoprefixer": "^7.2.3", | |
"babel-core": "^6.26.0", | |
"babelify": "^8.0.0", |
This file contains 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 | |
# note - /dev/xvdh that is what /dev/sdh is mapped to | |
devpath=$(readlink -f /dev/xvdh) | |
MNTPOINT=/images | |
sudo file -s $devpath | grep -q ext4 | |
if [[ 1 == $? && -b $devpath ]]; then | |
sudo mkfs -t ext4 $devpath | |
fi | |
This file contains 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
git branch -a | grep origin | grep --invert-match HEAD | xargs -n1 git show --no-patch --format="%cn %d |
This file contains 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
ActiveRecord::Base.send(:subclasses).map(&:name) |
This file contains 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
# Use awk to remove spaces. strips the trailing ":" from the first column | |
# adds quotes around the second. | |
heroku config --remote staging | grep -v "Config Vars" | awk '{print substr($1, 1, length($1)-1)"=""\""$2"\""}' > .env.developmen |
This file contains 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
"grep all filenames containing Interactor.swift, quote the output so that we can pass to xargs | |
"then sort by line count, then use awk again to remove some unnecessary columns | |
find Code | grep Interactor.swift | awk '{printf("\"%s\"\n", $0);}' | xargs wc | sort --reverse -k 1 | awk '{$2=$3=""}1' |
OlderNewer