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
#include <bluefruit.h> | |
/* | |
キーコード | |
*/ | |
#define FN_KEY 0x1000 | |
#define FN_BLE_1 0x1001 | |
#define FN_BLE_2 0x1002 | |
#define FN_BLE_INFO 0x1003 | |
#define FN_BLE_ADV 0x1004 |
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
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
# watch GPU status in windows | |
# while ($true -eq $true) { .\nvidia-smi.exe ; sleep 1 ; clear } | |
import tensorflow as tf | |
import six | |
tf.Session() | |
six.moves.input() |
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) |
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
[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
// 参考: | |
// 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
# Make directory tree as below | |
#-------------------- | |
#. | |
#├─ Makefile | |
#└─ src | |
# └─ main.c | |
#-------------------- | |
# Project settings | |
PROG = hello |
NewerOlder