Skip to content

Instantly share code, notes, and snippets.

Kazuho Okui naan

Block or report user

Report or block naan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@naan
naan / regex.swift
Last active Aug 29, 2015 — forked from mattt/regex.swift
Ruby-ish Regex class for Swift, inspired by Matt Thompson's Swift Regex extension: https://gist.github.com/mattt/2099ee21bbfbebaa94a3
View regex.swift
//
// Ruby-ish Regex class for Swift, inspired by Matt Thompson's Swift Regex extension: https://gist.github.com/mattt/2099ee21bbfbebaa94a3
//
// Use Regex class: (returns captured string arrays instead of Bool)
//
// if m = Regexp(pattern:"tuple\\(([^,]+),\\s*([^,]+)\\s*\\)").match("tuple(1.0, 2.0)") {
// m[0][0] is "tuple(1.0, 2.0)"
// m[0][1] is "1.0"
// m[0][2] is "2.0"
// }
@naan
naan / source_maps.rb
Last active Dec 14, 2015 — forked from alexspeller/source_maps.rb
Monkey patch for Coffee Script v.1.6.2 Source Maps for Rails.
View source_maps.rb
# config/initializers/source_maps.rb
if Rails.env.development?
module CoffeeScript
class SourceMapError < StandardError; end;
class << self
def compile script, options
script = script.read if script.respond_to?(:read)
@naan
naan / pre-commit.sh
Last active Dec 10, 2015
git pre-commit.sh for avoiding commit `console.*log` and `binding.pry`
View pre-commit.sh
#!/bin/sh
function check_forbidden_code {
git diff --cached --name-only | grep -E $1 > /dev/null || return
git diff --cached --name-only | grep -E $1 |\
GREP_COLOR='4;5;37;41' xargs grep --color --with-filename -E -n $2 && echo "COMMIT REJECTED Found '$2' references. Please remove them before commiting" && exit 1
}
JS_FILES_PATTERN='\.(js|coffee)(\..+)?$'
JS_FORBIDDEN='(console\..*log|debugger)'
View gist:1896450
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPause target:self action:@selector(pauseLesson:)];
self.navigationItem.leftBarButtonItem = nil;
View gist:1810743
diff --git a/app/Classes/HiraganyController.m b/app/Classes/HiraganyController.m
index 141b3ea..fac3ca7 100644
--- a/app/Classes/HiraganyController.m
+++ b/app/Classes/HiraganyController.m
@@ -121,7 +121,10 @@
converter.katakana = YES;
}
}
-
+ if (flags & NSControlKeyMask) {
View gist:1810723
diff --git a/app/Classes/HiraganyController.m b/app/Classes/HiraganyController.m
index 141b3ea..99421ca 100644
--- a/app/Classes/HiraganyController.m
+++ b/app/Classes/HiraganyController.m
@@ -66,6 +66,10 @@
DebugLog(@"flags: %X", flags);
return NO;
}
+ if (flags & NSControlKeyMask) {
+ DebugLog(@"flags: %X", flags);
View gist:910419
Incident Identifier: 5EBE0800-6841-41F1-B182-A60D0B07B056
CrashReporter Key: e4e4bf04a03ffcbb584bef075878501ff4290242
Hardware Model: iPhone1,2
Process: TwitterFon [94]
Path: /var/mobile/Applications/364D3420-7643-40C5-9219-1C0BAF2E29ED/TwitterFon.app/TwitterFon
Identifier: TwitterFon
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
View gist:910198
GET /__utm.gif?utmwv=4.9.1&utmn=1243260266&utmhn=www.echofon.com&utmt=event&utme=5(Download*iPhone*top%20page)&utmcs=UTF-8&utmsr=2560x1600&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=10.1%20r102&utmdt=Echofon&utmhid=682589617&utmr=0&utmp=%2F&utmac=UA-565580-11&utmcc=__utma%3D123338399.555096508.1298999836.1302101151.1302278563.5%3B%2B__utmz%3D123338399.1299823835.2.2.utmcsr%3Dads.soclnet.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F1%2Fdisplay_echofon%3B&utmu=T
View gist:910193
pageTracker._trackPageView()
http://www.google-analytics.com/__utm.gif?utmwv=4.9.1&utmn=1479174241&utmhn=www.echofon.com&utmcs=UTF-8&utmsr=2560x1600&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=10.1%20r102&utmdt=Echofon&utmhid=379153442&utmr=-&utmp=%2F&utmac=UA-565580-11&utmcc=__utma%3D123338399.555096508.1298999836.1302101151.1302278563.5%3B%2B__utmz%3D123338399.1299823835.2.2.utmcsr%3Dads.soclnet.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F1%2Fdisplay_echofon%3B&utmu=D
GET /__utm.gif?utmwv=4.9.1&utmn=1479174241&utmhn=www.echofon.com&utmcs=UTF-8&utmsr=2560x1600&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=10.1%20r102&utmdt=Echofon&utmhid=379153442&utmr=-&utmp=%2F&utmac=UA-565580-11&utmcc=__utma%3D123338399.555096508.1298999836.1302101151.1302278563.5%3B%2B__utmz%3D123338399.1299823835.2.2.utmcsr%3Dads.soclnet.com%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F1%2Fdisplay_echofon%3B&utmu=D HTTP/1.1
Host: www.google-analytics.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US
View gist:909263
http://www.google-analytics.com/__utm.gif?utmac=UA-565580-23&utmwv=4.4sh&utmhn=firefox.echofon.com&utmcc=__utma%3D999.999.999.999.999.1%3B&utmvid=713323&utmul=en-US&utmsr=2560x1600&utmsc=24-bit&utmp=%2Fmentions&utmr=-&utmn=1009884395&
GET /__utm.gif?utmac=UA-565580-23&utmwv=4.4sh&utmhn=firefox.echofon.com&utmcc=__utma%3D999.999.999.999.999.1%3B&utmvid=713323&utmul=en-US&utmsr=2560x1600&utmsc=24-bit&utmp=%2Fmentions&utmr=-&utmn=1009884395& HTTP/1.1
Host: www.google-analytics.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
You can’t perform that action at this time.