Skip to content

Instantly share code, notes, and snippets.

@adtac
adtac / Dockerfile
Last active July 24, 2024 14:11
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@taichi
taichi / .golangci.yml
Last active May 7, 2024 07:29
ロギングライブラリのあり方については別途要検討。zapやzerologを使うならファクトリ関数だけを置くようにした方がいいかも。
linters-settings: # 設定のデフォルト値は、https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml で確認できる
depguard: # packagesに宣言されているモジュールの取り扱いに関するルール。ブラックリスト形式で使っているので、列挙したものを使うとエラーになる。
list-type: blacklist
packages:
- golang.org/x/xerrors # go 1.13で必要な機能はすべてerrorsに取り込まれたので使わない
- github.com/rs/zerolog # ログ出力用のライブラリはプロジェクト内部に作ったファクトリ関数経由で使うため
packages-with-error-message:
- golang.org/x/xerrors: "エラー処理は標準のerrorsを使って下さい。スタックトレースが必要な場合のみpkg/errorsを使って下さい"
- github.com/rs/zerolog: "ログ出力は example.com/myproject/logger#Newから利用して下さい"
dupl: # コードのコピペを検出するルール。 閾値のトークン数を越えるものをエラーにする
@niw
niw / README.en.md
Last active July 23, 2024 15:51
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@voluntas
voluntas / loadtest.rst
Last active July 6, 2024 00:34
負荷試験コトハジメ
@suin
suin / README.md
Last active May 14, 2018 12:32
iTerm2の背景をポケモンにできるツールLazoCoder/Pokemon-Terminalの日本語ローマ字版データです。

iTerm2の背景をポケモンにできるツールLazoCoder/Pokemon-Terminalの日本語ローマ字版データです。英語名のポケモンじゃ分からない人向けです。例えば、イーブイにしたいときpokemon eeveeと打たないといけないところが、このデータをインストールするとpokemon i-buiでできるようになります。

インストール方法

Pokemon-Terminalをインストールした後に次のコマンドを実行して、ポケモン名データを書き換えてください

wget https://gist.githubusercontent.com/suin/7ba1e2b7a1feb5d0c01a6756f736d24d/raw/b210c99b105cf1a4a6854a55cf3d2f95dc981eba/pokemon.txt -O $HOME/.Pokemon-Terminal/Data/pokemon.txt
HANDLERS = Hello \
my.LogAggregator \
my.CountDaily \
my.CountHourly \
supecial.LogCollector
BRANCH=$(shell git rev-parse --abbrev-ref @)
JAR=$(BRANCH)/myproject-assembly-0.1.jar
all:
@suzuken
suzuken / ua.js
Last active September 9, 2020 15:22
experimental UDF on Bigquery with https://github.com/woothee/woothee-js.
var root = this;
// embed: dataset, util, browser, mobilephone, crawler, appliance, misc, woothee
// GENERATED from dataset.yaml at Thu Aug 13 14:22:28 JST 2015 by tagomoris
// Snapshot from package.json
var package_info = {"name":"woothee","version":"1.2.0","description":"User-Agent string parser (js implementation)","main":"./release/woothee","devDependencies":{"mocha":">= 1.7.0","chai":">= 1.3.0","js-yaml":">= 1.0.3","should":"~1.2.2"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"https://github.com/woothee/woothee-js"},"author":"tagomoris","license":"Apache v2"};
var dataset = {};
(function(){
anonymous
anonymous / anna-tan
Created December 2, 2013 09:17
アキチャッター
. ; . ..:::,..
,s555Srr;rrisSSs;:. ,. .::
,G5: .:;sSi; :ir;iX .2r.;9.
;@2B s2r . .;2i;sr s5 .5sAr .M
r@r@ , .3r :@r h. ;i rhs. s
r ;H;;2: :: 3; ;s Sr r.
:Ssr;2, ,G i5i .M &, Br;i::5, ;i H
ii, r#@i. H r:2 A. X:9 ;i r. ;@:3&h: B 9,
h @X.::B :iBi S S; ;s 2. H rS . Mr ;,s; & ,M
,2 .. ;2 r;B 5;
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@tsupo
tsupo / Twitter_API_1.1_rate_limit.txt
Created May 17, 2013 05:12
Twitter API 1.1 / 実行回数制限
Twitter API 1.1 の現行APIの制限
(REST API v1.1 Limits per window by resource)
https://dev.twitter.com/docs/rate-limiting/1.1/limits
・15分辺り最大何回実行できるか
Timelines
GET statuses/mentions_timeline 15回
GET statuses/user_timeline 180回/user, 300回/application