Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / rebaselock.pre-rebase.sh
Last active February 13, 2023 13:30
A pre-rebase hook that refuses to rebase if "branch.${BRANCH}.rebaselock" is true.
#!/bin/sh
#
# The "pre-rebase" hook is run just before "git rebase" starts doing
# its job, and can prevent the command from running by exiting with
# non-zero status.
#
# The hook is called with the following parameters:
#
# $1 -- the upstream the series was forked from.
# $2 -- the branch being rebased (or empty when rebasing the current branch).
@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 / 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}"
#!/usr/bin/env perl
use 5.014;
use warnings;
use Getopt::Long;
GetOptions(
'dry-run|n' => \my $opt_dry_run,
'force|f' => \my $opt_force,
);
#!/usr/bin/env ruby
puts "1"
puts "1"
puts "1"
puts "1"
puts "1"
print "\e[3A"
print "\e[3M"
abort
@uasi
uasi / honmono.md
Last active December 10, 2015 19:38
できるだけ何も調べずに書いた。

#本物のIT技術者はこんなことを意識します へのコメント

source: http://twishort.com/An8cc

★CSSスプライト(CSS Sprite)でYSlowのリクエスト数を減らす
CSS スプライトは、複数枚の画像を1枚に統合し、 CSS で表示範囲を指定するテクニック。 HTTP リクエストの数を減らすことでページの描画速度の向上が期待できる。 YSlow は Yahoo 製のベンチマークスクリプト。リクエスト数は YSlow に限った話ではないが間違いでもない。
★関係ない外国の方は、deny fromでできるだけお帰りいただく
Apache の Deny ディレクティブ? 90年代感はあるが日本(または特定の国)に特化したサービスならなくはないか。カリフォルニア向けなら関係ないなんてつれないことは言わないほうがいいと思う。
★要らないタグをできるだけ削る
要らないなら全部削る。