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
require 'sinatra' | |
require 'json' | |
require "sinatra/cookies" | |
session_timeout_seconds = 30 | |
before do | |
content_type 'application/json' | |
end |
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
var fs = require('fs') | |
var thirtySecondsInMillis = 30*1000; | |
function postAuthenticate(request, response, postData) { | |
var postDataDict = JSON.parse(postData); | |
console.log("* postAuthenticate: " + postData); | |
// console.log("* [RECVD KEY/VALUE] " + querystring.parse(postData).text); | |
console.log("* [RECVD JSON] " + postDataDict['username'] + " " + postDataDict['password']); | |
if (postDataDict['username'] == 'luther' && postDataDict['password'] == 'baker') { |
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
// taken from http://iphoneincubator.com/blog/tag/nslog | |
#ifdef DEBUG | |
# define DLOG(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#else | |
# define DLOG(...) | |
#endif | |
// ALog always displays output regardless of the DEBUG setting | |
#define ALOG(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); |
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
# Tracking a remote branch | |
git checkout -t origin/branchname | |
git checkout --track -b star origin/star | |
# Ignore changes to tracked files (.gitignore for untracked files) | |
git update-index --assume-unchanged <filenames> # begin ignoring changes to <filenames> | |
git update-index --no-assume-unchanged <filenames> # start tracking changes again to <filenames> |
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
$ brew update |
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
$ xcode-select --install |
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
$ sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install calabash-cucumber | |
$ ruby -v | |
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13] | |
$ gem env | |
RubyGems Environment: | |
- RUBYGEMS VERSION: 2.0.3 | |
- RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [universal.x86_64-darwin13] | |
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0 |
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
# install frank | |
$ sudo gem install frank-cucumber | |
# setup project | |
$ frank setup | |
$ frank build | |
$ frank launch | |
$ frank inspect |
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
## | |
## update ruby, https://github.com/sstephenson/rbenv | |
## | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
## |
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
// https://developer.apple.com/library/ios/documentation/userexperience/conceptual/LocationAwarenessPG/MapKit/MapKit.html | |
// Initialize the semaphore to 0 because there are no resources yet. | |
dispatch_semaphore_t snapshotSem = dispatch_semaphore_create(0); | |
// Get a global queue (it doesn't matter which one). | |
dispatch_queue_t queue = dispatch_get_global_queue(myQueuePriorityLevel, 0); | |
// Create variables to hold return values. Use the __block modifier because these | |
variables will be modified inside a block. |
OlderNewer