Skip to content

Instantly share code, notes, and snippets.

@uasi
uasi / gist:9046447
Created February 17, 2014 07:48
Xcode build phase that writes git revision to Info.plist in built product
GIT_REVISION=$(git rev-parse --short HEAD 2> /dev/null)
if [ $? != 0 ]; then
GIT_REVISION="(not in git repo)"
elif [ -n "$(git status --porcelain)" ]; then
GIT_REVISION="${GIT_REVISION}+dirty"
fi
PLIST_PATH="${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/Info.plist"
/usr/libexec/PlistBuddy -c "Set :GitRevision ${GIT_REVISION}" "${PLIST_PATH}"
@uasi
uasi / html2yaml.rb
Created February 17, 2014 08:21
Dump HTML outline as YAML
require 'nokogiri'
require 'open-uri'
require 'optparse'
require 'yaml'
def pod_from_node(node)
data = YAML::Omap.new
data[:name] = node.node_name
@uasi
uasi / git-patchbox
Created September 6, 2014 05:27
git-patchbox
#!/bin/sh
#
# git-patchbox
#
# Saves a series of patches from the given revision to HEAD as
# <toplevel>/,patchbox/<name>.mbox and then reset to the revision.
#
if [ "x$1" = "x" -o "x$2" = "x" ]; then
@uasi
uasi / keybase.md
Created September 30, 2014 01:53
keybase.md

Keybase proof

I hereby claim:

  • I am uasi on github.
  • I am uasi (https://keybase.io/uasi) on keybase.
  • I have a public key whose fingerprint is B050 DEDB 9FF6 6432 BFE7 E906 BE6C 2A4D BCEE 89EB

To claim this, I am signing this object:

@uasi
uasi / CDEvents+RACExtensions.h
Created October 18, 2014 04:29
CDEvents+RACExtensions
//
// CDEvents+RACExtensions.h
// Kobito
//
// Copyright (c) 2014 Increments Inc. All rights reserved.
//
#import <CDEvents/CDEvents.h>
@class RACSignal;
@uasi
uasi / EXNOnDealloc.h
Created October 18, 2014 04:50
EXNOnDealloc
//
// EXNOnDealloc.h
//
// Copyright (c) 2014 uasi. All rights reserved.
//
#import <libextobjc/metamacros.h>
#define onDeallocOfObject(object) \
autoreleasepool {} \
@uasi
uasi / git-prune-branches.sh
Created October 24, 2014 05:19
git prune-branches
#!/bin/sh
#
# git-prune-branches - prune merged branches
#
# Configurations:
# .git/protected-branches - one-line regex matching the names of the branches to be protected.
#
if [ "`git branch | grep '^\*'`" != "* master" ]; then
@uasi
uasi / html51.md
Last active August 29, 2015 14:08

1.4歴史 第5段落

2003年に、ウェブフォームの次世代として位置づけられた技術であるXFormsの公表は、HTMLの代替を見つけることよりも、進化するHTML自身に再び関心を巻き起こした。 この関心は、ウェブ技術が(RSSや後のAtomのような)新しい技術に限られていたXMLの展開というよりむしろ、(HTMLのような)実際に展開された技術の置換から生まれた。

原文

In 2003, the publication of XForms, a technology which was positioned as the next generation of Web forms, sparked a renewed interest in evolving HTML itself, rather than finding replacements for it. This interest was borne from the realization that XML's deployment as a Web technology was limited to entirely new technologies (like RSS and later Atom), rather than as a replacement for existing deployed technologies (like HTML).

私案

@uasi
uasi / set_lang_locale.bash
Last active August 29, 2015 14:18
Language and Locale Settings
defaults write com.adobe.Flash AppleLanguages -array ja
defaults write com.adobe.Flash AppleLocale ja_JP
@uasi
uasi / ghq-foreach.sh
Created April 14, 2015 06:09
ghq で管理している各リポジトリでコマンドを実行する ghq-foreach 書いた ref: http://qiita.com/uasi/items/610ef5745fc35745fd54
#!/bin/bash
#
# ghq-foreach - executes git subcmd or shell cmd for each repo managed by ghq
#
EXEC=
QUIET=
say() {