Skip to content

Instantly share code, notes, and snippets.

@s-aska
s-aska / thumbnail.go
Created October 4, 2017 07:41
サムネイル生成くん
package main
import (
"fmt"
"image"
"image/jpeg"
"io/ioutil"
"os"
"path"
"path/filepath"
@s-aska
s-aska / capture.go
Created September 5, 2017 01:16
request capture
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
<script type="text/javascript">
if (location.protocol != 'https:') {
location.href = 'https:' + location.href.substring(location.protocol.length);
}
</script>
醤油
料理酒
みりん
味覇
味噌
おろし生姜チューブ
おろしにんにくチューブ
塩胡椒
砂糖
片栗粉
plackup -MData::Dumper -e 'sub { [200, [], [Dumper(\@_)]] }'
🍲: やま中(もつ鍋)
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/

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

Image

grafana/grafana:latest

ENV例

{"domains":["aska.pw","justaway.info","tasks.7kai.org"]}
class TwitterText {
// swiftlint:disable:next force_try
static let linkDetector = try! NSDataDetector(types: NSTextCheckingType.Link.rawValue)
class func count(text: String, hasImage: Bool) -> Int {
let textLength = text.characters.count // 🍣 is 1
let objcLength = text.utf16.count // 🍣 is 2
let objcText = text as NSString
let objcRange = NSRange(location: 0, length: objcLength)