This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/igrigorik/em-http-request/blob/master/examples/fibered-http.rb | |
require "pp" | |
require "rubygems" | |
require "eventmachine" | |
require "em-http" | |
require "fiber" | |
module Foo | |
EM < ::EventMachine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defscrollback 5000 | |
escape ^Jj | |
msgwait 1 | |
logfile "/tmp/log-screen-%Y%m%d-%n.log" | |
deflog on | |
cjkwidth on | |
caption always "%{= Kw}%n %t" | |
hardstatus alwayslastline "%{= kw}%`%-w%{=b rw}%n %t%{-}%+w %= [%Y-%m-%d %02c]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://patshaughnessy.net/2012/1/4/never-create-ruby-strings-longer-than-23-characters | |
require 'benchmark' | |
ITERATIONS = 2000000 # original script was 1000000 | |
def run(str, bench, op=nil) | |
p = case op | |
when :<< | |
lambda { new_string = str << "x" } # String#<< は破壊的なので毎回strも変わる |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source $HOME/.bash_profile | |
ulimit -m 4194304 | |
ulimit -v 1024000 | |
ulimit -a | |
/usr/bin/google-chrome $CHROME_OPTIONS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -- coding: utf-8 | |
require "pp" | |
require "rubygems" | |
require 'sinatra' | |
require 'sinatra/base' | |
module Sinatra | |
module Helpers | |
class Stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://gist.github.com/634586 | |
ID=$1 | |
if [ -z "$ID" ];then | |
echo "Usage: ${0} [snowflake id]" | |
exit 0 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var LS = { | |
_: {}, | |
_timer: null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from http://project-p.jp/halt/?p=1726 | |
$ sed -r 's/^.+;| .+$//g' ~/.zsh-history|sort |uniq -c |sort -nr|head -n 30 | |
2224 git | |
1869 ruby | |
1390 sudo | |
1364 vim | |
1117 cd | |
889 ls | |
755 find |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// http://nob-log.info/2012/04/12/phper-filter-validate-email/ | |
$times = 10000; | |
$result = array(); | |
// preg_match | |
// regexp is stolen from: | |
// https://github.com/php/php-src/blob/master/ext/filter/logical_filters.c#L525 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ci: 395 | |
-m: 334 | |
"added: 51 | |
"fix: 19 | |
"remove: 18 | |
"fixed: 12 | |
"changed: 6 | |
"improve: 6 | |
"update: 5 | |
"use: 5 |