Skip to content

Instantly share code, notes, and snippets.

Avatar

Shinichiro Aska s-aska

View GitHub Profile
View papa-download.js
'use strict';
const now = new Date();
const addDays = function(date, days) {
const d = new Date(date);
d.setDate(d.getDate() + days);
return d;
};
const toYMD = function(date) {
View agh-stock-widget.js
(function(){
"use strict";
const template = '<span class="fontsize-m" style="margin-right: 6px;"><a href="https://stocks.finance.yahoo.co.jp/stocks/detail/?code={{ .stock.Code }}.T" class="underline">{{ .stock.Code }}(JQ)</a></span>{{ .stock.Close | Commify }}円&nbsp;<br class="show_sp"><small class="fontsize-m">前日比:{{ .stock.Diff | Commify }}円 出来高:{{ .stock.Volume | Commify }}株</small>';
const script = document.createElement('script');
script.src = 'https://denkei-agh-tools-prod.an.r.appspot.com/?callback=stockWidgetCallback&symbol=1783.T';
const parent = document.getElementsByTagName('script')[0];
parent.parentNode.insertBefore(script, parent);
window.stockWidgetCallback = (res) => {
console.log(res);
const inner = document.getElementById('widget-inner');
@s-aska
s-aska / fuck-the-azure-proxy.go
Created Oct 11, 2017
azure-functions-cli(nodejs) で text/html がエラーになるので proxy 書いた
View fuck-the-azure-proxy.go
package main
import (
"io"
"net/http"
"strings"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
@s-aska
s-aska / thumbnail.go
Created Oct 4, 2017
サムネイル生成くん
View thumbnail.go
package main
import (
"fmt"
"image"
"image/jpeg"
"io/ioutil"
"os"
"path"
"path/filepath"
@s-aska
s-aska / capture.go
Created Sep 5, 2017
request capture
View capture.go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
View redirect-https.html
<script type="text/javascript">
if (location.protocol != 'https:') {
location.href = 'https:' + location.href.substring(location.protocol.length);
}
</script>
View dump.psgi
plackup -MData::Dumper -e 'sub { [200, [], [Dumper(\@_)]] }'
View gourmet.txt
🍲: やま中(もつ鍋)
http://tabelog.com/fukuoka/A4001/A400104/40004383/
🍲: 水たき 長野
http://tabelog.com/fukuoka/A4001/A400102/40000010/
🐡: 天ぷら ひらお
http://tabelog.com/fukuoka/A4001/A400107/40000033/
🐡: 割烹よし田(鯛茶漬け)
http://tabelog.com/fukuoka/A4001/A400103/40000692/
🐔: ????????(ちんぷんかんぷん)
https://retty.me/area/PRE40/ARE135/SUB13502/100000784924/
View Scanner.swift
//
// DataScanner.swift
// DataScanner
//
// Created by Shinichiro Aska on 8/20/15.
// Copyright © 2015 Shinichiro Aska. All rights reserved.
//
import Foundation
View Grafana-on-Arukas.md

Grafanaは素で入れると面倒なのでArukasなどでdocker runすると最高なんですが、その際に GF_DATABASE_ を設定しておかないと再起動の度にダッシュボードの設定が飛んでしまいます。 Arukasはまだβ版で不意に再起動していることがあるので油断なりません。 ダッシュボードの保存先はデフォルトで sqlite ですがオプションで MySQL / PostgreSQL に対応しています、以前は ElasticSearch や InfluxDB に対応していたようですが、最新バージョンではこれらRDBMSしか選択できません。

Image

grafana/grafana:latest

ENV例

You can’t perform that action at this time.