This file contains 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
git archive --format=zip HEAD > Sample.zip |
This file contains 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
ruby -rubygems -e 'require "jekyll-import"; | |
JekyllImport::Importers::WordpressDotCom.run({ | |
"source" => "wordpress.xml", | |
"tags" => false, | |
"more_excerpt" => true, | |
"more_anchor" => true | |
})' |
This file contains 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
def main | |
begin | |
fr = File::open(ARGV[0],"r") | |
rescue | |
else | |
depth = 0 | |
buf = "" | |
fr.read.each_char{|c| | |
if c == '{' | |
depth = depth + 1 |
This file contains 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
void hoge(NSString* temp) { | |
DNSLog(@"------------------%ld", temp.length); | |
NSData *data = [temp dataUsingEncoding:NSUTF8StringEncoding]; | |
unichar *uni = nil; | |
uni = (unichar*)malloc(sizeof(unichar) * temp.length); | |
[temp getCharacters:uni]; | |
for (int i = 0; i < [temp length]; i++) { | |
NSLog(@"%d - %04x", i, *(uni + i )); | |
} |
This file contains 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
if (self.attributedString != nil && [self.attributedString.string rangeOfString:@"これになる不思議"].location != NSNotFound) { | |
DNSLog(@"%@", self.attributedString); | |
UniChar *p = (UniChar*)malloc(sizeof(UniChar) * self.attributedString.string.length); | |
[self.attributedString.string getCharacters:p]; | |
FILE *fp = fopen("/Users/sonson/bug_data.bin", "wb"); | |
fwrite(p, sizeof(UniChar), self.attributedString.string.length, fp); | |
fclose(fp); | |
free(p); | |
This file contains 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 | |
paths = [] | |
paths.push(ARGV[0] + "/**/*.h") | |
paths.push(ARGV[0] + "/**/*.m") | |
blacklist = ["/imobile/", "/nend/", "/Google/", "/Evernote/", "/admob/", "/TestFlight/", "/UICoderz/"] | |
lines = 0 |
This file contains 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
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { | |
// スワイプのジェスチャを開始するかを判定する | |
if ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) { | |
UIPanGestureRecognizer *panGesture = (UIPanGestureRecognizer *)gestureRecognizer; | |
CGPoint velocity = [panGesture velocityInView:panGesture.view]; | |
double radian = atan(velocity.y/velocity.x); | |
double degree = radian * 180 / M_PI; | |
// 指定した角度よりも大きく(斜めに)スワイプした場合は,ジェスチャは開始されない |
This file contains 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 is OK | |
NSString *temp = [NSString stringWithFormat:@"title BEGINSWITH %@", searchBar.text]; | |
NSPredicate *predicate = [NSPredicate predicateWithFormat:temp]; | |
// Bad... | |
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"title BEGINSWITH %@", searchBar.text]; |
This file contains 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 | |
GIT_MARKETING_VERSION=`git describe --abbrev=0 --tags` | |
GIT_REVISION=`git rev-parse --short HEAD` | |
GIT_COMMIT_TIMES_STRING=`git log --since=2000-01-01 --oneline --no-merges | wc -l` | |
let GIT_COMMIT_TIMES=GIT_COMMIT_TIMES_STRING+13000 | |
cat > ./2tch/info.prefix <<EOT |
This file contains 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 'octokit' | |
api_div_html_text = <<"EOS" | |
<div class="toc"><ul><li><strong>API methods</strong><span class="mode-selector"><a class="mode mode-current" href="/dev/api">by section</a><a class="mode " href="/dev/api/oauth">by oauth scope</a></span><ul><li><a href="#section_account" class="section">account</a><ul><li class="supports-oauth"><a href="#GET_api_v1_me">/api/v1/me</a></li><li class="supports-oauth"><a href="#GET_api_v1_me_blocked">/api/v1/me/blocked</a></li><li class="supports-oauth"><a href="#GET_api_v1_me_friends">/api/v1/me/friends</a></li><li class="supports-oauth"><a href="#GET_api_v1_me_karma">/api/v1/me/karma</a></li><li class="supports-oauth"><a href="#GET_api_v1_me_prefs">/api/v1/me/prefs</a></li><li class="supports-oauth"><a href="#GET_api_v1_me_trophies">/api/v1/me/trophies</a></li><li class="supports-oauth"><a href="#GET_prefs_blocked">/prefs/blocked</a></li><li class="supports-oauth"><a href="#GET_prefs_friends">/prefs/friends</a></li><li class="supports-oauth"><a href="#GET_prefs_{ |
OlderNewer