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
declare module "express-pino-logger" { | |
import { LoggerOptions, Logger, Level } from "pino" | |
import { IncomingMessage, ServerResponse } from "http" | |
function ExpressPinoLogger(opts?: Options): HttpLogger; | |
export = ExpressPinoLogger; | |
type HttpLogger = (req: IncomingMessage, res: ServerResponse) => void; | |
interface Options extends LoggerOptions { |
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
{ | |
"type": "mysql", | |
"host": "db", | |
"port": 3306, | |
"username": "root", | |
"password": "test", | |
"database": "test", | |
"synchronize": true, | |
"logging": false, | |
"entities": [ |
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 RetryPromise(maxRetry, interval) { | |
this._maxRetry = maxRetry || 3 | |
this._interval = interval || 1000 | |
} | |
RetryPromise.prototype.do = function (fn) { | |
var _this = this | |
var retryCount = 0 | |
return new Promise(function (resolve, reject) { | |
(function self() { |
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(){ | |
const prices = document.querySelectorAll(".list tr:not(:first-child) .price a"); | |
sumPrice = Array.prototype.reduce.call(prices, function(a, b) { | |
const priceText = b.innerText; | |
return a + parseInt(priceText.replace(/¥|,/g,"")); | |
},0); | |
alert("合計: " + sumPrice); | |
})(); |
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
Usage: | |
android [global options] action [action options] | |
Global options: | |
-s --silent : Silent mode, shows errors only. | |
-v --verbose : Verbose mode, shows errors, warnings and all messages. | |
--clear-cache: Clear the SDK Manager repository manifest cache. | |
-h --help : Help on a specific command. | |
Valid | |
actions |
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
<?php | |
if($argc != 3) { | |
exit("引数の数が正しくありません".PHP_EOL | |
."サンプル".PHP_EOL | |
."php parse.php 辞書データファイル名 出力先ファイル名".PHP_EOL); | |
} | |
$xml = simplexml_load_file($argv[1]); | |
$outputData = ""; | |
foreach($xml->array->dict as $item) { |
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 'opencv' | |
include OpenCV | |
def play | |
Thread.new do | |
puts `afplay\ fami.mp3` | |
sleep 3; | |
$flag = false | |
end | |
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
require 'open-uri' | |
require 'fileutils' | |
#保存する地域設定 | |
#地域のディレクトリ名を調べて追加してください | |
#取得したくない地域の先頭に#を付けるとその地域を取得しない | |
#例(kobeを取得しない) #"kobe", という感じ | |
areaArr = [ | |
"kobe", | |
"kyoto", |
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
#設定用のJAVA_HOMEを作成 | |
export JAVA_HOME=`/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home -v "1.7"` | |
#パスに書き出す | |
PATH=$PATH:${JAVA_HOME}/bin | |
export PATH |