$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'fluent/counter'
require 'benchmark'
require 'stackprof'
PORT = 4321
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
require "fssm" | |
DEFAULT_BREAK_TIME = 10 | |
TEX_CMD = "ptex2pdf -l -ot '\''-halt-on-error -synctex=1 -shell-escape'\'' master.tex" | |
BIBTEX_CMD = "pbibtex master" | |
class LazyExecutor | |
def initialize(break_time, &block) | |
@break_time = break_time | |
@m = Mutex.new |
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
#!/usr/bin/env ruby | |
class FileDiffExtractor | |
DIFF_HUNK_REGEX = / | |
^@@\s | |
[^\s]+\s # Ignore old file range | |
\+(\d+)(?:,(\d+))? # Extract range of hunk containing start line and number of lines | |
\s@@.*$ | |
/x | |
def call |
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
(global-set-key (kbd "M-g M-g") '(lambda () | |
(interactive) | |
(if (and mark-active transient-mark-mode) | |
(helm-git-grep-at-point) | |
(helm-git-grep)))) | |
;; Cask | |
(depends-on "helm-git-grep") |
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 | |
USAGE="\ | |
Usage: wifi <action> | |
ACTIONS: | |
on turn on a wifi network | |
off turn off a wifi network | |
list show all avaible wifi networks |
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 | |
DIR="$HOME/.kasumi" | |
function cached_imgcat() { | |
local cached="$DIR/tmp_$1" | |
if [[ -f $cached ]]; then | |
: | |
else | |
convert -resize 512x512 "$DIR/$1" "$cached" |
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 | |
USAGE="\ | |
Usage: slider [-e <extension>] slide_directory" | |
PAGE= | |
DIR= | |
EXT="png" | |
function imagecat_if_exist() { |
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
def start | |
Proc.new.call(1) | |
end | |
start { |x| p x } | |
#=> 1 |
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
class A | |
def run | |
begin | |
p obj | |
rescue | |
obj = 10 | |
end | |
p obj | |
end |
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
import Control.Monad.State | |
import GHC.Base((<|>)) | |
import Data.Char | |
type Result = Either String | |
type Parser v = StateT String Result v | |
runParser = runStateT |