Skip to content

Instantly share code, notes, and snippets.

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

Target source

$LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'fluent/counter'
require 'benchmark'
require 'stackprof'

PORT = 4321
#!/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
@ganmacs
ganmacs / helm-git-grep-with-region.el
Last active August 2, 2016 14:04
範囲選択してたら選択してる文字列をデフォルトとするやつ
(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")
#!/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
#!/bin/bash
DIR="$HOME/.kasumi"
function cached_imgcat() {
local cached="$DIR/tmp_$1"
if [[ -f $cached ]]; then
:
else
convert -resize 512x512 "$DIR/$1" "$cached"
#!/bin/bash
USAGE="\
Usage: slider [-e <extension>] slide_directory"
PAGE=
DIR=
EXT="png"
function imagecat_if_exist() {
def start
Proc.new.call(1)
end
start { |x| p x }
#=> 1
class A
def run
begin
p obj
rescue
obj = 10
end
p obj
end
@ganmacs
ganmacs / calc.hs
Last active November 11, 2016 05:17
import Control.Monad.State
import GHC.Base((<|>))
import Data.Char
type Result = Either String
type Parser v = StateT String Result v
runParser = runStateT