Skip to content

Instantly share code, notes, and snippets.

View heavenshell's full-sized avatar
💭
Use Vim

Shinya Ohyanagi heavenshell

💭
Use Vim
  • Hyogo, Japan
  • 14:32 (UTC +09:00)
View GitHub Profile
@heavenshell
heavenshell / gist:1644435
Created January 20, 2012 01:36
htmlcat install log
Building and testing https://github.com/motemen/App-htmlcat/tarball/master
cp lib/App/htmlcat.pm blib/lib/App/htmlcat.pm
cp bin/htmlcat blib/script/htmlcat
/opt/local/bin/perl "-Iinc" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/htmlcat
Manifying blib/man3/App::htmlcat.3pm
PERL_DL_NONLAZY=1 /opt/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t xt/*.t
t/00_compile.t ...... ok
xt/01_podspell.t .... skipped: no working spellchecker found
# Failed test 'Test::Perl::Critic for "lib/App/htmlcat.pm"'
@heavenshell
heavenshell / quickrun.vim
Created March 3, 2012 04:57
QuickRun.vim syntax
if exists('b:current_syntax')
finish
endif
if !exists('main_syntax')
let main_syntax = 'quickrun'
endif
syntax case ignore
@heavenshell
heavenshell / oppy.py
Created March 4, 2012 13:54
Sample script for `How to download oppy images ver 2012`.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
oppy!oppy!oppy!
~~~~~~~~~~~~~~~
Sample script for `How to download oppy images ver 2012`.
This script is porting from Perl script.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
oppy!oppy!oppy!
~~~~~~~~~~~~~~~
Sample script for `How to download oppy images ver 2012`.
This script is porting from Perl script.
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use DBI;
my $data_source = 'dbi:mysql:database=foo;host=localhost;mysql_socket=/var/run/mysql5/mysqld.sock';
my $username = 'bar';
my $auth = '';
my $dbh = DBI->connect($data_source, $username, $auth);
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def func(first=None, **kwargs):
print first
print kwargs
args = {'name': 'foo', 'age': 20}
func('foo', **args)
/private/var/folders/7z/7zrdl0IuGomopqiYjB5rA++++TI/-Tmp-/vuPnWTz/1 の処理中に
エラーが検出されました:
行 526:
E227: fb というマッピングは既に存在します
@heavenshell
heavenshell / bench.py
Created March 19, 2012 02:34
JSON benchmark
# original code is https://github.com/voluntas/snowflake/blob/feature/json/bench.py
import timeit
import json
import simplejson
import ujson
def bench(binary):
simplejson.dumps(simplejson.loads(binary))
12/03/21 18:40:01 Safari[77065] SafariTabConfig installed.
12/03/21 18:40:18 Safari[77065] -[NSProcessInfo enableSuddenTermination] has been invoked more times than necessary to balance invocations of -[NSProcessInfo disableSuddenTermination]. Ignoring.
$ sar -u 2 10000
16:09:04 %usr %nice %sys %idle
16:09:06 13 0 3 85
16:09:08 13 0 2 85
16:09:10 12 0 3 85
16:09:12 12 0 3 85
16:09:14 16 0 4 80
16:09:16 14 0 4 82