Skip to content

Instantly share code, notes, and snippets.

@va2577
va2577 / SetLastWriteTime.ps
Created April 9, 2017 04:37
[Windows]ファイルの更新日時を一括で変更するコマンド(PowerShell)
Get-ChildItem -Recurse |
Where-Object { $_ -is [System.IO.FileInfo] } |
ForEach-Object { Set-ItemProperty $_.FullName -Name LastWriteTime -Value ("2016/02/07" + " " + $_.LastWriteTime.ToString("HH:mm:ss")) }
@va2577
va2577 / upload.js
Created June 11, 2017 07:05
[Node.js]ファイルのアップロードとダウンロード
/**
* npm install --save express multer
*/
const express = require('express');
const fs = require('fs');
const multer = require('multer');
const path = require('path');
const app = express();
const storage = multer.diskStorage({
@va2577
va2577 / upload.py
Created June 11, 2017 07:11
[Python 3]ファイルのアップロードとダウンロード
# pip install bottle
# [Bottle: Python Web Framework — Bottle 0.13-dev documentation](https://bottlepy.org/docs/dev/index.html)
import datetime
import os
from bottle import Bottle, redirect, request
app = Bottle()
p = os.path.abspath(os.path.dirname(__file__))
@app.route('/')
@va2577
va2577 / nhk_radiru.sh
Created September 10, 2017 09:29
[Bash]NHKラジオ らじる★らじる
#!/bin/bash
# http://www.nhk.or.jp/radio/config/config_web.xml?v170809
url_r1='https://nhkradioakr1-i.akamaihd.net/hls/live/511633/1-r1/1-r1-01.m3u8'
url_r2='https://nhkradioakr2-i.akamaihd.net/hls/live/511929/1-r2/1-r2-01.m3u8'
url_fm='https://nhkradioakfm-i.akamaihd.net/hls/live/512290/1-fm/1-fm-01.m3u8'
type ffmpeg > /dev/null 2>&1 || {
echo "$(basename ${0}) requires ffmpeg."
exit 1
@va2577
va2577 / app.js
Created March 22, 2018 06:18
[Node.js]express-session のサンプルアプリ
const path = require('path')
const express = require('express')
const session = require('express-session')
const app = express()
app.use(express.static(path.join(__dirname, 'public')))
const sess = {
secret: 'keyboard cat',
resave: true,
@va2577
va2577 / simulation.html
Created May 5, 2018 07:13
口座残高の推移のシミュレーション
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>simulation</title>
<style>
input#simulate {
width: 100%;
}
input.error {
@va2577
va2577 / daily.json
Last active May 6, 2018 04:07
[Python 3]米ドル/円の折れ線グラフ
[[1496005200000,"111.295","111.467","111.124","111.222"],[1496091600000,"111.265","111.317","110.657","110.827"],[1496178000000,"110.845","111.225","110.484","110.766"],[1496264400000,"110.768","111.481","110.65","111.347"],[1496350800000,"111.334","111.711","110.326","110.43"],[1496610000000,"110.315","110.73","110.303","110.452"],[1496696400000,"110.451","110.512","109.218","109.383"],[1496782800000,"109.411","109.881","109.096","109.81"],[1496869200000,"109.811","110.381","109.378","109.972"],[1496955600000,"109.983","110.812","109.721","110.323"],[1497214800000,"110.311","110.44","109.624","109.931"],[1497301200000,"109.925","110.27","109.786","110.06"],[1497387600000,"110.045","110.343","108.82","109.572"],[1497474000000,"109.554","110.979","109.258","110.911"],[1497560400000,"110.925","111.415","110.637","110.89"],[1497819600000,"110.841","111.601","110.704","111.526"],[1497906000000,"111.514","111.782","111.306","111.454"],[1497992400000,"111.434","111.738","111.035","111.375"],[1498078800000,"111.337"
@va2577
va2577 / simulation.html
Created May 8, 2018 07:33
期待値による口座残高の推移
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>simulation</title>
<style>
input#simulate {
width: 100%;
}
input.error {
@va2577
va2577 / simulation.html
Created May 9, 2018 12:55
二つのパターン(ランダム、期待値)の口座残高の推移
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>simulation</title>
<style>
input#simulate {
width: 100%;
}
input.error {
@va2577
va2577 / resample.ipynb
Created May 15, 2018 08:03
ヒストリカルデータリサンプリング
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.