Skip to content

Instantly share code, notes, and snippets.

Scott Penrose spenrose

View GitHub Profile
View gist:c3117888abf4b114c28421d326ef2037
### Keybase proof
I hereby claim:
* I am spenrose on github.
* I am spenrose ( on keybase.
* I have a public key ASBuW-sWnW4llUKpzJ9QgIkU3QRjA-jOsKBD7AJSYElwjwo
To claim this, I am signing this object:
spenrose / clean_xliff.rb
Created Jun 1, 2016
When importing xliff files into Xcode it does not convert new lines to `\n`. This results in broken strings files.
View clean_xliff.rb
require 'nokogiri'
filename = "filename.xliff"
out_filename = "out_filename.xliff"
doc = { |f| Nokogiri::XML(f) }
source = doc.css("trans-unit source")
source.each { |s|
s.content = s.content.gsub("\n", "\\n")
spenrose / BothCommandKeysPressed.xml
Last active Dec 14, 2015
Remap all keys when holding down left and right commands. This version is for dvorak keyboards.
View BothCommandKeysPressed.xml
<?xml version="1.0"?>
<name>Alt keyboard with Command_L + Command_R</name>
<name>Rebind all keys when both command keys are pressed</name>
<identifier vk_config="true">notsave.smp_alt_keyboard</identifier>
<autogen>__KeyToKey__ KeyCode::A, KeyCode::MINUS</autogen> <!-- A to [ -->
<autogen>__KeyToKey__ KeyCode::SEMICOLON, KeyCode::EQUAL</autogen> <!-- S to ] -->
<autogen>__KeyToKey__ KeyCode::S, KeyCode::MINUS, ModifierFlag::SHIFT_L</autogen> <!-- O to { -->
spenrose / Gemfile
Created Jan 26, 2013
Rakefile for Xcode projects.
View Gemfile
source ""
# Rakefile
gem "rake"
gem "xcoder"
gem "open4"
gem "spinning_cursor"
spenrose / gist:4539571
Last active Dec 11, 2015
Logging macros
View gist:4539571
// Logging Macros
#ifdef DEBUG
# define DLog(FORMAT, ...) printf("%s %s ~ %s\n", [[[NSDate date] description] UTF8String], __PRETTY_FUNCTION__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])
# define DLog(...)
// ALog always displays output regardless of the DEBUG setting
#define ALog(FORMAT, ...) printf("%s %s ~ %s\n", [[[NSDate date] description] UTF8String], __PRETTY_FUNCTION__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])
You can’t perform that action at this time.