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
Get-ChildItem -Filter "*.flac" | % { ffmpeg.exe -i "$_" -acodec alac "$($_.BaseName).m4a" } |
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
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
network={ | |
ssid="SSID" | |
#psk="password" | |
psk=2f6a0beddf2f0588ee426b0c3a0e3d9a523bb07a05cb857f85d826da80fa75c4 | |
} |
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
@echo off | |
rem 指定した作業ディレクトリでCmderを立ち上げるバッチ | |
rem 使い方: Cmder.bat <作業ディレクトリ> | |
rem 本来Cmderは/STARTオプションで起動するディレクトリが指定できるはずだが、 | |
rem 指定を無視してCmderを呼び出したプログラムの作業ディレクトリで起動してしまう。 | |
rem とりあえずの対策として、このバッチでコマンドプロンプトを噛ませることにした。 | |
rem HKEY_CLASSES_ROOT\Directory\shell\Cmder Here\commandに「launch_cmder.bat "%V"」で | |
rem 登録すると、フォルダの右クリックメニューに出てくれて便利。 |
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
// 標準入力から1行ずつ読み込み | |
var readLineFromStdin = function(callback) { | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
// 入力(の一部)が到着 | |
var fragment = ''; | |
process.stdin.on('data', function(chunk) { | |
if (chunk === '') { | |
return; |
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 strict'; | |
/* | |
Calculate Levenshtein distance(edit dstance) between str1 and str2. | |
*/ | |
const calculateLevenshteinDistance = (str1, str2) => { | |
// Initialize distance table | |
let distanceTable = new Array(str1.length + 1); | |
for (let row = 0; row < str1.length + 1; row++) { | |
distanceTable[row] = new Array(str2.length + 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
{ | |
"env": { | |
"node": true, | |
"es6": true | |
}, | |
"rules": { | |
"array-bracket-spacing": [ | |
2, | |
"never" | |
], |
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
const https = require('https'); | |
const url = require('url'); | |
exports.handler = function(event, context) { | |
// prepare https POST request | |
const reqOptions = url.parse(process.env.SLACK_WEBHOOK_URL); | |
reqOptions.method = 'POST'; | |
reqOptions.headers = { | |
'Content-Type': 'application/json' | |
}; |
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
# Make directory tree as below | |
#-------------------- | |
#. | |
#├─ Makefile | |
#└─ src | |
# └─ main.c | |
#-------------------- | |
# Project settings | |
PROG = hello |
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
server { | |
listen 80; | |
server_name example.com; | |
charset UTF-8; | |
auth_basic "Login message"; | |
auth_basic_user_file /path/to/.htpasswd; | |
location / { | |
proxy_redirect off; |
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://www.misuzilla.org/Blog/2016/01/31/CreateYourOwnHttpServerUsingCSharp | |
// http://qiita.com/akiray03/items/3607c60ec8b221b3c2ba (Node.jsはブロックしないよ!) | |
'use strict'; | |
const net = require('net'); | |
const HTTP_RESPONSE = [ | |
"HTTP/1.0 200 OK", |
OlderNewer