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
context(@"when generating strings for uploading", ^{ | |
it(@"should return the points as a string", ^{ | |
NSString *pointsAsString = [_testPath pointsDataAsString]; | |
expect([pointsAsString isKindOfClass:[NSString class]]).to.beTruthy(); | |
}); | |
it(@"can recreate the points from this string", ^{ | |
NSString *pointsString = [_testPath pointsDataAsString]; | |
NSData *pointsData = [NSData dataWithBase64EncodedString:pointsString]; | |
expect(pointsData).to.equal(_testPath.points); |
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 Control.Monad | |
-- http://code.google.com/codejam/contest/351101/dashboard#s=p1 | |
-- | |
-- Compile with: | |
-- ghc -O reverse_words.hs | |
-- | |
-- Run as: | |
-- ./reverse_words < input_file > output_file | |
-- | |
-- Unless otherwise indicated, all modules used are either bundled with |
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 | |
# A simple script that recurses through the current directory and runs | |
# git garbage collection on the bare repositories | |
# v1.0 | |
# Current version available at https://gist.github.com/4358819 | |
Dir.glob("**/*.git") do |dir| | |
working_dir = File.expand_path dir | |
puts "#{dir} being garbage collected." |
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
- (NSURL)URLFromString:(NSString *)string; | |
{ | |
static NSPasteboard *pboard; | |
if (!pboard) pboard = [[NSPasteboard pasteboardWithUniqueName] retain]; | |
[pboard clearContents]; | |
[pboard writeObjects:@[string]]; | |
NSURL *result = [WebView URLFromPasteboard:pboard]; | |
return result; |
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
module Main where | |
{- | |
Problem statement: | |
http://code.google.com/codejam/contest/351101/dashboard#s=p1 | |
Run as a script with runghc, or compile with ghc --make -O2 | |
input and output is by redirection; |
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
// | |
// FakeNotificationCentre.h | |
// | |
// After Graham Lee | |
// | |
// Ghetto mock for unit testing. | |
#import <Foundation/Foundation.h> | |
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
module Main where | |
{- | |
- Problem Statement: | |
- http://code.google.com/codejam/contest/351101/dashboard#s=p1 | |
- | |
- Usage either compile or use runhaskell / runghc | |
- Pass the input file as the sole command line argument | |
- Redirect output if you want the results to go in a file | |
-} |
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
// | |
// NSDate+RandomDate.h | |
// | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSDate (RandomDate) | |
- (NSDate *)randomDateInYearOfDate; |
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 sh | |
# Tidy up whitespace on commit. | |
# By-pass it with the --no-verify option to git commit | |
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |
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
// | |
// NSURL+ADNFileHelpers.h | |
// | |
// Created by Abizer Nasir on 02/08/2011. | |
// | |
// Public Domain because I love you | |
#import <Foundation/Foundation.h> | |
@interface NSURL (ADNFileHelpers) |