Skip to content

Instantly share code, notes, and snippets.

@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 / git-svn.markdown
Last active March 5, 2024 07:06
git-svn の使い方メモ

git-svn の使い方メモ

git-svn の使い方をメモする。他によいプラクティスがあれば指摘していただけるとありがたい。

用語

SVN のブランチと git のブランチが混在しているため、ここではブランチという語を以下のように区別する。

  • ブランチ、 SVN ブランチ:$SVN_REPO/branches 以下にあるディレクトリ
  • ローカルブランチ:git のローカルブランチ
  • リモートブランチ:git のリモートブランチ
@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"
@uasi
uasi / curl_easy.inko
Last active August 17, 2023 16:02
curl_easy.inko
import std.stdio.STDOUT
import extern 'c'
fn extern fopen(path: Pointer[UInt8], mode: Pointer[UInt8]) -> Pointer[UInt8]
import extern 'curl'
fn extern curl_easy_init -> Pointer[UInt8]
fn extern curl_easy_setopt(handle: Pointer[UInt8], option: Int32, ...) -> Int32
fn extern curl_easy_perform(handle: Pointer[UInt8]) -> Int32
fn extern curl_easy_cleanup(handle: Pointer[UInt8])
@uasi
uasi / pixiv_bookmark_downloader.rb
Last active May 3, 2023 20:26
A utility to download bookmarked items from pixiv
#!/usr/bin/env ruby
#
# Usage:
# export PIXIV_ID=<your pixiv ID>
# export PIXIV_PASSWORD=<your pixiv password>
# pixiv_bookmark_downloader.rb [download_dir]
#
# This script downloads your bookmarked items to
# <download_dir>/<member_id>/<image_name> (e.g. downloads/123/456.jpg)
@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 / pbtail.rkt
Created March 1, 2021 05:15
pbtail.rkt
#!/usr/bin/env racket
#lang racket
(require racket/base)
(require racket/port)
(require racket/system)
(define (pbpaste)
(with-output-to-string
@uasi
uasi / tmux.conf
Created November 16, 2011 17:20
Embedding shell script in .tmux.conf
# cat <<__DATA__ >/dev/null
# Your tmux configuration here
set-option -g prefix C-t
unbind-key C-b
bind-key C-t send-prefix
# Call foo
run "cut -c3- ~/.tmux.conf | sh -s foo"
# Call bar
@uasi
uasi / Safari.classdump.h
Created June 8, 2011 11:25
Class dump of Safari 5.1 DP
/*
* Generated by class-dump 3.3.3 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2010 by Steve Nygard.
*/
#pragma mark Named Structures
struct AccessibilityObject {
void **_field1;
@uasi
uasi / defer.rs
Last active May 12, 2017 11:25
"defer" in Rust (virtually useless)
// rustc 1.0.0-nightly (44a287e6e 2015-01-08 17:03:40 -0800)
#![feature(unboxed_closures)]
#![feature(unsafe_destructor)]
macro_rules! defer {
($($body:stmt);* ;) => {
let __deferred = Deferred::new(|| { $($body);* ; });
}
}