Style settings for Objective-C in XCode
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
# this script sets up a new symfony 1.4.x installation and installs the propel ORM plugin on Mac OS X | |
#!/bin/bash | |
if [ $# == 0 ]; then | |
echo "Usage: $0 projectname" | |
exit 1 | |
fi | |
mkdir $1 && cd $1 |
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
#!/usr/bin/bash | |
# Clone rbenv and set it up to build versions of ruby | |
git clone git://github.com/sstephenson/rbenv.git .rbenv | |
mkdir -p ~/.rbenv/plugins | |
cd ~/.rbenv/plugins | |
git clone git://github.com/sstephenson/ruby-build.git | |
# Optional |
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 "#{File.dirname(__FILE__)}/../lib/transactions.rb" | |
include Transactions | |
def capture_stdout(&block) | |
original_stdout = $stdout | |
$stdout = fake = StringIO.new | |
begin | |
yield | |
ensure | |
$stdout = original_stdout |
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
describe('Model', function(){ | |
it('something', function(done){ | |
request('http://google.com', function(response){ | |
console.log(response); | |
done(); | |
}) | |
}); | |
}); |
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 "canopy.js" | |
cacheControls(); | |
verifyText('notclicked', "Not Clicked"); | |
tap("clickme"); | |
verifyText('notclicked', "Clicked"); |
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
speed <- 55 | |
distance <- 2 | |
speeds <- seq(54, 0) | |
h <- function(x) ceiling((distance / (speed - x)) * 3600) | |
g <- Vectorize(h) | |
times = g(speeds) |
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
NSDictionary *systemVersionDictionary = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; | |
NSString *reqSysVer = @"10.7"; | |
NSString *currSysVer; | |
currSysVer = [systemVersionDictionary objectForKey:@"ProductVersion"]; | |
// For testing | |
// currSysVer = @"10.10"; | |
if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending) | |
NSLog(@"Version requirement met"); | |
else | |
NSLog(@"Version requirement not met"); |
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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int count = 0; | |
string temp = ""; | |
while (count < 10) | |
{ |
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
#!/usr/bin/env ruby | |
require 'net/https' | |
https = Net::HTTP.new('encrypted.google.com', 443) | |
https.use_ssl = true | |
https.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
https.request_get('/') |
OlderNewer