Skip to content

Instantly share code, notes, and snippets.

@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 / Gemfile
Created December 1, 2012 13:18
Sinatra starter kit
source :rubygems
gem 'thin'
gem 'sinatra'
gem 'sinatra-flash', require: 'sinatra/flash'
gem 'slim'
gem 'twitter'
gem 'omniauth'
gem 'omniauth-twitter'
@uasi
uasi / brew-install-version.sh
Created June 25, 2012 07:30
brew install-version (a Homebrew command that install a specific version of a formula with ease)
#!/usr/bin/env zsh
if [[ $# -lt 2 ]]; then
print -P "%UUsage%u: brew install-version [install options] FORMULA VERSION"
exit 1
fi
formula=
version=
install_opts=()
@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 / gist:1401211
Created November 28, 2011 17:32
self.bless does not set value to public attribute
use v6;
class T {
has $!foo = 'foo';
has $.bar = 'bar';
method new($i) {
self.bless(*, foo => $i, bar => $i);
}
@uasi
uasi / install.pl
Created November 20, 2011 16:51
dotfiles installer
#!/usr/bin/perl
use 5.008;
use strict;
use warnings;
use Cwd 'realpath';
use File::Basename 'basename';
use Getopt::Long;
@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
#!/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,
);
@uasi
uasi / parcel-and-context.pl
Created October 20, 2011 16:56
A mystery of parcel and context in Perl 6
use v6;
sub section(|$c) { print '-- '; say($c); }
section 'WHAT is a parcel';
((1, 2), (3, 4)).WHAT.say; # Parcel()
((1, 2), (3, 4)).elems.say; # 2
section 'WHAT is a parcel-in-list-context';
list((1, 2), (3, 4)).WHAT.say; # List()
@uasi
uasi / Localizable.strings
Created October 9, 2011 08:19
Alternative Japanese localization for Growl 1.3.1
/* No comment provided by engineer. */
"Alert! Enabling this option will add Growl.app to your login items" = "注意!このオプションをオンにすると Growl がログイン項目に追加されます";
/* No comment provided by engineer. */
"Allowing this will let Growl launch everytime you login, so that it is available for applications which use it at all times" = "ログイン時に Growl を起動し、すべてのアプリケーションから使えるようにする";
/* No comment provided by engineer. */
"Application: %@\nTitle: %@\nDescription: %@\nClick to open the log" = "アプリケーション: %1$@\nタイトル: %2$@\n説明: %3$@\nクリックしてログを開く";
/* No comment provided by engineer. */