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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"github.com/garyburd/redigo/redis" | |
) |
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 | |
set -eu | |
XML_URL="http://www.nhk.or.jp/radio/config/config_web.xml" | |
XML="/tmp/config_web.xml.$$" | |
trap 'rm $XML; exit 1' 1 2 3 15 | |
date=$(date '+%Y-%m-%d-%H-%M') |
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
local VK_SEMICOLON = 0x29 | |
local VK_ESC = 0x35 | |
local VK_RIGHT_BRACKET = 0x21 | |
local VK_J = 0x26 | |
-- Auto reload config | |
function reloadConfig(files) | |
doReload = false | |
for _,file in pairs(files) do | |
if file:sub(-4) == ".lua" then |
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
a = [1,2,3,4] | |
for i in a do | |
a.push(i) | |
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
kernel = command('uname -r').stdout.chop! | |
describe package("linux-image-extra-#{kernel}") do | |
it { should be_installed } | |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and | |
// a slice of URLs found on that page. |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
package main | |
import ( | |
"io" | |
"os" | |
"strings" | |
) | |
type rot13Reader struct { | |
r io.Reader |
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
package main | |
import "golang.org/x/tour/reader" | |
type MyReader struct{} | |
// TODO: Add a Read([]byte) (int, error) method to MyReader. | |
func (r MyReader) Read(b []byte) (int, error) { | |
b[0] = 'A' | |
return 1, nil |
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 | |
LANG=ja_JP.utf8 | |
date=`date '+%Y-%m-%d-%H-%M'` | |
outdir="." | |
#引数:[Ch.名] [録音秒数] [出力先] [ファイル名] | |
# [録音秒数]は30秒増しに録られる | |
# [ファイル名]は[ファイル名]-YYYY-MM-DD-HH-mm.m4aで保存される。デフォルトは[Ch.名] |
NewerOlder