Skip to content

Instantly share code, notes, and snippets.

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);
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) {
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPause target:self action:@selector(pauseLesson:)];
self.navigationItem.leftBarButtonItem = nil;
@naan
naan / pre-commit.sh
Last active December 10, 2015 02:18
git pre-commit.sh for avoiding commit `console.*log` and `binding.pry`
#!/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)'
@naan
naan / source_maps.rb
Last active December 14, 2015 13:48 — forked from alexspeller/source_maps.rb
Monkey patch for Coffee Script v.1.6.2 Source Maps for Rails.
# 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 / regex.swift
Last active August 29, 2015 14:05 — 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
//
// 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"
// }