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
#!/bin/bash | |
USAGE="usage: git-gc-all [repositories_directory]" | |
if [[ -z $1 ]]; then | |
wd=`pwd` | |
elif [[ $1 == "--help" ]]; then | |
echo "runs git-gc in each subdirectory of current directory." | |
echo $USAGE | |
exit |
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/local/bin/python3.0 | |
import os | |
import re | |
def skip_updated(input): | |
for line in input: | |
if not_updated_regexp.match(line): | |
return |
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
Intent sendIntent = new Intent(Intent.ACTION_SEND); | |
sendIntent.setType("image/png"); //or "message/rfc822" | |
ContentResolver cr = getContentResolver(); | |
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(status.url)); | |
String postfix = (status.recognized()) ? "success" : "failure"; | |
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Captured images: " + postfix); | |
sendIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" }); | |
startActivity(Intent.createChooser(sendIntent, "Send images")); |
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
NSString * path = [[NSBundle mainBundle] pathForResource:<#Resource name#> ofType:@"plist"]; | |
NSData * plistXML = [[NSFileManager defaultManager] contentsAtPath: path]; | |
NSString * errorDesc = nil; | |
NSPropertyListFormat format; | |
<#Variable name#> = (<#Type of top level element#> *)[NSPropertyListSerialization propertyListFromData:plistXML mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&errorDesc]; | |
if (nil == <#Variable name#>) { | |
NSLog(@"Can not load <#What#>."); | |
if (errorDesc) { | |
NSLog(@"Error description: %@", errorDesc); | |
[errorDesc release]; errorDesc = nil; |
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
export LC_CTYPE=en_US.UTF-8 | |
export PATH=$PATH:~/scripts:/opt/local/bin:/Developer/usr/bin:/usr/local/texlive/2009/bin/universal-darwin:/usr/local/git/bin/ | |
export EDITOR='mate -w' | |
export GIT_EDITOR="mate -wl1" | |
export LESSEDIT='mate -l %lm %f' | |
PS1="%n@%m:%20~%#> " | |
autoload -U compinit | |
compinit | |
zstyle ':completion:*:descriptions' format '%U%B%d%b%u' | |
zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b' |
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
.DS_Store | |
.svn | |
*.mode1v3 | |
*.pbxuser | |
project.xcworkspace |
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
// | |
// UIDeviceHardware.h | |
// | |
// Used to determine EXACT version of device software is running on. | |
#import <Foundation/Foundation.h> | |
@interface UIDeviceHardware : NSObject | |
+ (NSString *) platform; |
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/python | |
# HOW TO USE THIS SCRIPT: | |
# 0. Install [Day One CLI](http://dayoneapp.com/tools/) | |
# 1. Get your XML files using [Live Journal's export form](http://www.livejournal.com/export.bml) | |
# 2. Run this script against every exported file (yes, you get tons of XML files — it's a good idea to automate this step). The shell command should look like this | |
# `ls -1 *.xml | xargs -n1 lj-to-dayone -u username` | |
# assuming you have all your XMLs in current directory and lj-to-dayone on your PATH (or in the same directory). | |
# Author: Leonty Deriglazov, 14/07/2013. |
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/python | |
import re | |
import sys | |
import codecs | |
generated_regex = re.compile(r"/\*(?P<comment>.*?)\*/[\n\r]*\"(?P<key>.*?)\"\s*=\s*\"(?P<value>.*?)\";", re.S) | |
handcrafted_regex = re.compile(r"\"(?P<key>.*?)\"\s*=\s*\"(?P<value>.*?)\";(?P<comment>)", re.S) | |
def parse(file_name, regex, encoding = "utf-8"): |
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
_adjustDoubleHeightTextVisibility | |
_backgroundFrameForAttributes: | |
_backgroundView | |
_beginDisablingRasterizationForReason: | |
_clearOverrideHeight | |
_crossfadeToNewBackgroundView | |
_crossfadeToNewForegroundViewWithAlpha: | |
_currentComposedData | |
_currentComposedDataForStyle: | |
_currentStyleAttributes |
OlderNewer