Skip to content

Instantly share code, notes, and snippets.

@thinkerbot
thinkerbot / gem_env.sh
Created November 8, 2010 18:28
Illustrates GEM_HOME vs GEM_PATH
# Two ENV variables control the 'gem' command:
#
# GEM_HOME: the single path to a gem dir where gems are installed
# GEM_PATH: a standard PATH to gem dirs where gems are found
#
# A gem directory is a directory that holds gems. The 'gem' command will lay
# out and utilize the following structure:
#
# bin # installed bin scripts
# cache # .gem files ex: cache/gem_name.gem
@uasi
uasi / vim.rb
Created November 30, 2010 16:46
Vim formula for Homebrew (EDIT: recent versions of official Homebrew distribution includes one)
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.682'
def features; %w(tiny small normal big huge) end
@uasi
uasi / create-chrome-launcher.sh
Created March 23, 2011 05:31
Create an .app that launches Google Chrome with a specified profile
#!/bin/sh
#
# Create Google Chrome launcher (for Mac)
#
CHROME_APP="/Applications/Google Chrome.app"
CHROME_PROFILE_DIR="$HOME/Library/Application Support/Google/Chrome"
echo "Enter profile name: \c"
class PixivImage
include Mongoid::Document
field :image_id
field :pixiv_user_id
field :title
field :tags, :type => Array
field :url
field :image_url
field :description
field :saved, :type => Boolean, :default => false
@hetima
hetima / 01_setMenuProxy.m
Created July 27, 2011 10:27
WebKit2 context menu hack
// based on http://d.hatena.ne.jp/uasi/20110722/1311275712
IMP orig_setMenuProxy;
// オリジナルの setMenuProxy: と差し替えるメソッド
void ST_setMenuProxy(id self, SEL _cmd, void *menuProxy)
{
// オリジナルのメソッドを呼んでやる
orig_setMenuProxy(self, _cmd, menuProxy);
// menuProxy は WebContextMenuProxyMac クラスのポインタ
@tily
tily / example.txt
Created August 3, 2011 08:52
マクガフィン自動生成
白い瓶に封じられたディスク
茶色のハンドバッグに隠されたセキュリティカード
赤いビニール袋に入ったIDカード
茶色のペットボトルに詰めこまれた宝の地図
赤い謎の像に入った地図
紫色のワインボトルに封じられた証拠写真
金色の段ボール箱に厳重に保管された覚醒剤
銀色のコーラの空き缶に入っているフロッピーディスク
銀色のペンに入った覚せい剤
金色の空き缶に詰められたヘロイン
@hetima
hetima / (1)STWKClientHook.m
Created August 14, 2011 15:31
WebKit2 WKView client hook for Safari 5.1
//
// STWKClientHook.m
#import "STWKClientHook.h"
#import <objc/message.h>
struct STWKOrderedClientCluster{
struct WKPageLoaderClient loader;
struct WKPagePolicyClient policy;
struct WKPageFormClient form;
@laiso
laiso / gist:1217214
Last active October 29, 2020 18:18
[日記] 厨2病フレーズだけで記述できるプログラミング言語 のイメージ
# 厨2病フレーズだけで記述できるプログラミング言語 のイメージ
何ッ ()
もしも それ が 真実 なの ならば———
これ は 大変なことになるぞ! (いや?)\
まぁ…… いい…
ククク…… 見せてもらおうじゃないか…… ←\
旋律 の 傀儡師 の 実力とやらを! # TODO なぜだ!? 動く!?
@VienosNotes
VienosNotes / CA.pl
Created December 15, 2011 06:25
1-Dimentional Cellular Automaton
use v6;
class CA {
has @.data;
has @.rule;
method new ($rule, $length, $population) {
my @data = (1 xx $population, 0 xx $length - $population).pick(*);
my @rule = $rule.fmt("%08b").flip.comb.map({.Int});
self.bless(*, data => @data, rule => @rule);
@rummelonp
rummelonp / zsh_completion.md
Last active February 22, 2023 15:06
zsh の補完関数の自作導入編

zsh の補完関数の自作導入編

あまり深く理解してないので識者のツッコミ大歓迎

補完を有効にする

取り敢えず最低限だけ

# 補完を有効にする