Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
git stash
git symbolic-ref HEAD refs/heads/$1
rm .git/index
git clean -f -d
# (via johnw)
From 1feae123089ec8c205c805edbe58f63f4c3cfe14 Mon Sep 17 00:00:00 2001
From: Scott Chacon <schacon@gmail.com>
Date: Wed, 6 Aug 2008 12:35:34 -0700
Subject: [PATCH] updated grit to use the working directory for status
---
vendor/gems/grit/lib/grit/repo.rb | 2 ++
vendor/gems/grit/lib/grit/status.rb | 32 +++++++++++++++++---------------
2 files changed, 19 insertions(+), 15 deletions(-)
test gist
test gist
test gist
test gist
test gist
test
- (BOOL)writeApplicationData:(NSData *)data toFile:(NSString *)fileName {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
if (!documentsDirectory) {
NSLog(@"Documents directory not found!");
return NO;
}
NSString *appFile = [documentsDirectory stringByAppendingPathComponent:fileName];
return ([data writeToFile:appFile atomically:YES]);
}
-module(test).
-export([list_range/4, split_range/1]).
split_range(Range) ->
Each = round(Range / 8),
list_range([], 0, Each, Range).
list_range(Range, Start, Each, Max) ->
End = Start + Each,