Skip to content

Instantly share code, notes, and snippets.

View kaosf's full-sized avatar
🏠
Working from home

ka kaosf

🏠
Working from home
View GitHub Profile
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoops
I did typo 2.1.1. (2.2.1 is correct.)
#!/usr/bin/perl
# This is a fork of http://www.opensource.apple.com/source/X11apps/X11apps-44/xterm/xterm-269/vttests/256colors2.pl?txt
# $XTermId: 256colors2.pl,v 1.10 2009/10/10 14:45:26 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999-2007,2009 by Thomas E. Dickey
# Copyright 2002 by Steve Wall
export PATH=/usr/lib/postgresql/9.3/bin:$PATH
mkdir ~/postgresql
cd ~/postgresql
mkdir socket
initdb pg
echo unix_socket_directories = '/home/myname/postgresql/socket' >> pg/postgresql.conf
postgres -D pg
createdb mydbname # Error!
@kaosf
kaosf / vim-environment.md
Created January 13, 2015 16:59
Vim environment (Ubuntu 14.04 on 2015-01-14)

OS: Ubuntu 14.04 amd64

vim --version result:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan  2 2014 19:39:59)
Included patches: 1-52
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version with GTK2 GUI.  Features included (+) or not (-):
@kaosf
kaosf / Gemfile
Last active September 20, 2017 03:29
earthquakeをRuby 2.4.0でインストールして動かすためのGemfile on 2017-02-20
source 'https://rubygems.org'
gem 'earthquake',
git: 'https://github.com/kaosf/earthquake',
branch: 'master'
# SHA1: b845de4c363aa3df7820f049d36aae210969d1d2
gem 'twitter-stream',
git: 'https://github.com/kaosf/twitter-stream',
branch: 'master'
@kaosf
kaosf / convert-red-to-blue.sh
Created December 25, 2014 13:35
An ImageMagick Convert command for when ordering "Change this red image to blue."
# ref. http://blog.tanarky.com/2009/08/imagemagickconvert_19.html
convert -fuzz 50% -fill '#0000ff' -opaque '#ff0000' src.jpg dst.jpg
@kaosf
kaosf / 2014-precure-advent-calendar-23.md
Last active August 29, 2015 14:12
はじけるCommonの香り!キュアClojure!

プリキュア Advent Calendar 2014 - Adventar の 23 日目の記事です.

Clocure

Clojure + Precureという意味で命名された,PycureおよびRubicureリスペクトです.

つまり世界初のLispによるプリキュア実装です.更にJVMのためのプリキュア実装でもあります.

ソースコードは kaosf/clocure にあります.ここから Clojars (Clojureのライブラリ登録サービス) へのリンクなども確認出来ます.

@kaosf
kaosf / 2014-precure-advent-calendar-21.md
Last active August 29, 2015 14:11
2014プリキュアアドベントカレンダー21日目 か(@ka_あるいは@kaosf)のふたりはプリキュアSplash☆Star思い出話
@kaosf
kaosf / sidekiq-cron.md
Created December 3, 2014 07:43
SidekiqのCron化について

ondrejbartas/sidekiq-cron

を参照すると良いかもしれません.詳しい使い方は知りませんがこれを用いてcron的に動いているものはあるので実績はあるはずです.

Sidekiq::Cron::Job.load_from_hash(
  {
    'name': {
      'cron': '* * * * *',
 'class': MyWorker,
# ref. http://stackoverflow.com/questions/3392813/how-can-i-get-a-lazy-array-in-ruby
fib = Enumerator.new { |y|
a = b = 1
loop {
y << a
a, b = b, a + b
}
}
p fib.take(10)