Skip to content

Instantly share code, notes, and snippets.

@cooldaemon
cooldaemon / README
Created August 18, 2009 05:52
This is a command that makes the keyword file for Objective-C.
$ ./objc_dict_maker.pl -in /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers
or
$ ./objc_dict_maker.pl -in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers
@cooldaemon
cooldaemon / GetSnippetsList.diff
Created August 10, 2009 08:45 — forked from thinca/GetSnippetsList.diff
neocomplcache + snipMate
*** snipMate.vim.old 2009-04-23 02:30:12.703125000 +0900
--- snipMate.vim 2009-04-23 01:41:56.890625000 +0900
***************
*** 187,190 ****
--- 187,202 ----
let num = inputlist(snippet) - 1
return num == -1 ? '' : s:multi_snips[a:scope][a:trigger][num][1]
endf
+
+ fun GetSnippetsList(ft)
@cooldaemon
cooldaemon / Makefile
Created July 21, 2009 15:36
This is a sample for DBM.
CC = gcc
SOURCES = $(wildcard *.c)
OBJECTS = $(SOURCES:%.c=%.o)
TARGET = test
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -o $@
.c.o:
@cooldaemon
cooldaemon / Makefile
Created July 16, 2009 02:22
This is a sample for Tokyo Cabinet.
CC = gcc
SOURCES = $(wildcard *.c)
OBJECTS = $(SOURCES:%.c=%.o)
TARGET = test
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -o $@ \
-ltokyocabinet -lz -lbz2 -lpthread -lm -lc
@cooldaemon
cooldaemon / Makefile
Created July 11, 2009 14:31
Asynchronous test in Objective-C.
CC = gcc
SOURCES = $(wildcard *.m)
OBJECTS = $(SOURCES:%.m=%.o)
TARGET = test
$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -o $@ -framework Foundation
.m.o:
@cooldaemon
cooldaemon / Makefile
Created May 5, 2009 06:51
libxml2 sax sample.
xml2_sax_sample: xml2_sax_sample.c
gcc -o xml2_sax_sample `xml2-config --cflags --libs` xml2_sax_sample.c
clean:
rm xml2_sax_sample
@cooldaemon
cooldaemon / keep_state.erl
Created April 7, 2009 16:00
Restore state on supervisor restart.
-module(keep_state).
-author('cooldaemon@gmail.com').
-export([test/0]).
test() ->
keep_state_sup:start_link(),
{} = keep_state_server:get_state(),
keep_state_server:put_state(foo),
foo = keep_state_server:get_state(),
setlocal makeprg=~/bin/ttlint.pl\ %
package MIME::Lite::TT::JP::Mobile;
use strict;
use warnings;
use version; our $VERSION = qv('0.0.1');
use Carp;
use English qw(-no_match_vars);
@cooldaemon
cooldaemon / deploy.rb
Created October 30, 2008 08:55
This recipe is used by the Webistrano.
set(:shared_children){
(exists?(:shared_dirs) ? shared_dirs.split(/\s/).push("log") : %w(log))
}
namespace :deploy do
desc "finalize update."
task :finalize_update, :except => { :no_release => true } do
run "chmod -R g+w #{latest_release}" if fetch(:group_writable, true)