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
# 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
// 参考: | |
// 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", |
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
[Unit] | |
Description=Disable brightness control by ACPI video module | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/sh -c "/usr/bin/echo -n 0 > /sys/module/video/parameters/brightness_switch_enabled" | |
[Install] | |
WantedBy=multi-user.target |
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
BIOS+GPT環境で起動してzshが立ち上がったところから | |
---- | |
# loadkeys jp106 | |
# ping -c 3 www.google.com | |
# lsblk(インストール先ディスク確認、以下/dev/sdaの例) | |
# gdisk /dev/sda | |
* /dev/sda1に100MB(/boot, コード8300) |
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 sys | |
import cv2 | |
# pattern matching | |
def find(image, template): | |
ret_i = 0 | |
ret_val = 0 | |
for i in range(len(template)): | |
res = cv2.matchTemplate(image, template[i], cv2.TM_CCORR_NORMED) | |
min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res) |
OlderNewer