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/sh | |
# usage extractaudio input output | |
avconv -i $1 -vn -c:a copy $2 |
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://www.google.co.jp/search?hl=ja&tbo=1&tbs=qdr:y&pws=0&complete=0&q=%s |
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 'date' | |
module Horoscopes | |
CONSTELLATIONS = [ | |
:capricorn, | |
:aquarius, | |
:pisces, | |
:aries, |
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 'date' | |
require 'digest/sha1' | |
module PaperFortune | |
def self.paper_fortune(w, *a) | |
n = w.inject(&:+) | |
r = Random.new(Digest::SHA1.hexdigest(Marshal.dump(a)).to_i(16)).rand(n) | |
w.each_index.find {|i| r < w[0..i].inject(&:+) } |
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
(function($) { | |
// Used by dateinput | |
$.expr = {':': {}}; | |
// Used by bootstrap | |
$.support = {}; | |
// Used by dateinput | |
$.fn.clone = function(){ | |
var ret = $(); |
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 'parallel' | |
module Jekyll | |
class Site | |
def render | |
payload = site_payload | |
self.posts.zip(Parallel.map(self.posts) {|post| | |
post.render(self.layouts, payload) |
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/sh | |
wget --keep-session-cookies --save-cookies=cookies.txt --post-data 'id=...&password=...' url | |
wget --load-cookies=cookies.txt -r url |
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
TEX = master.tex | |
DVI = $(TEX:.tex=.dvi) | |
PDF = $(TEX:.tex=.pdf) | |
AUX = $(TEX:.tex=.aux) | |
TMP = $(TEX:.tex=.bbl) $(TEX:.tex=.blg) $(TEX:.tex=.log) | |
BIB = $(wildcard *.bib) | |
PRN = $(wildcard *.prn) | |
PNG = $(wildcard *.png) | |
JPG = $(wildcard *.jpg) | |
EPS = $(PRN:.prn=.eps) $(PNG:.png=.eps) $(JPG:.jpg=.eps) |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\Classes\*\Shell] | |
[HKEY_CURRENT_USER\Software\Classes\*\Shell\Vim] | |
@="Vimで開く(&V)" | |
[HKEY_CURRENT_USER\Software\Classes\*\Shell\Vim\command] | |
@="D:\\Documents\\tools\\vim\\gvim.exe --remote-silent \"%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 CPUAffinity | |
def self.set_affinity(mask, pid = Process.pid) | |
system "taskset -p 0x#{mask.to_s(16)} #{pid}" | |
end | |
end |