Skip to content

Instantly share code, notes, and snippets.

@abcang
abcang / gist:a43aad8d48651ed45ec643162251a463
Created September 26, 2017 15:40
sudo journalctl -u mastodon-web -ex
Sep 27 00:23:36 testingmstdn bundle[9244]: [d1337715-20f7-4cf7-b1f7-842ba0bb3737] method=POST path=/inbox format=html controller=ActivityPub::InboxesController action=create status=201 duration=7.03 view=0.00 db=0.80
Sep 27 00:25:44 testingmstdn bundle[9244]: [d76b42aa-c29c-4ed5-a8b2-a2c5aefbde75] method=POST path=/inbox format=html controller=ActivityPub::InboxesController action=create status=201 duration=3.47 view=0.00 db=0.48
Sep 27 00:26:11 testingmstdn bundle[9244]: [07a22087-0dbe-4897-a1df-29a677b4fe97] method=POST path=/inbox format=html controller=ActivityPub::InboxesController action=create status=201 duration=3.52 view=0.00 db=0.47
Sep 27 00:26:50 testingmstdn bundle[9244]: [50752041-027b-4f2c-b53c-63aa31946c3f] method=POST path=/inbox format=html controller=ActivityPub::InboxesController action=create status=201 duration=4.27 view=0.00 db=0.27
Sep 27 00:26:57 testingmstdn bundle[9244]: [efedbdc9-8aae-449a-9c54-40bd1925e9dd] method=POST path=/inbox format=html controller=ActivityPub::InboxesControl
@abcang
abcang / gist:1db9d5307cd25dee63c655c4b8b041c9
Created September 26, 2017 14:39
PawooでDMを送ったときのInboxesControllerの様子
| 1 | # frozen_string_literal: true
| 2 |
| 3 | class ActivityPub::InboxesController < Api::BaseController
| 4 | include SignatureVerification
| 5 |
| 6 | before_action :set_account
| 7 |
| 8 | def create
18 (15.3%) | 9 | if signed_request_account
1 (0.8%) | 10 | upgrade_account
@abcang
abcang / capture_sample.js
Last active September 12, 2018 02:58
Headless Chromeを使った画面キャプチャのサンプル
const { Launcher } = require('chrome-launcher');
const CDP = require('chrome-remote-interface');
const util = require('util');
const fs = require('fs');
const writeFile = util.promisify(fs.writeFile);
async function setDeviceSize(Emulation, deviceMetrics) {
const { width, height } = deviceMetrics;
await Emulation.setDeviceMetricsOverride(deviceMetrics);
### Keybase proof
I hereby claim:
* I am abcang on github.
* I am abcang (https://keybase.io/abcang) on keybase.
* I have a public key whose fingerprint is E7AB C7F7 ECDE 7A70 749C EC3B 9EF3 EA2E 8807 6B19
To claim this, I am signing this object:
@abcang
abcang / gist:45d3c8b9ed9080364d02217fba583a73
Created April 4, 2017 16:25
adblockでブラックリスト方式にするためのカスタムフィルタ
@@*$document,domain=~example.com|~example.jp|~example.org
@abcang
abcang / knex.js
Created April 1, 2017 11:10
knexでスネークケースとキャメルケースを変換してくれる設定
const config = {};
const knex = require('knex')(config);
const { decamelize, camelizeKeys } = require('humps');
// スネークケースをキャメルケースに変換
const formatterPrototype = knex.client.formatter().constructor.prototype;
// eslint-disable-next-line no-underscore-dangle
const originalWrapString = formatterPrototype._wrapString;
// eslint-disable-next-line no-underscore-dangle
@abcang
abcang / himado_hot_key.user.js
Last active February 19, 2017 19:26
Himado hot key
// ==UserScript==
// @name Himado hot key
// @namespace https://abcang.net/
// @version 0.2
// @description enable hot key on himado
// @author ABCanG
// @match http://himado.in/*
// @grant none
// ==/UserScript==
@abcang
abcang / meiro.txt
Created September 11, 2016 06:15
適当に作った迷路
14 14
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 0 0 1 3 0 1 1 1 1 1 0 1
1 0 0 1 0 1 0 0 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 1 0 0 0 1 0 1 0 1 0 1 0 1
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1
1 1 1 1 1 0 0 0 0 1 0 1 0 1 1
1 0 0 0 0 0 0 1 1 1 0 0 0 1 1
1 1 1 1 0 1 0 0 1 1 1 0 0 1 1
@abcang
abcang / nicomoveframe.user.js
Created June 25, 2016 09:09
ニコニコの動画を矢印キーで数秒進めたり戻したりできるやつ
// ==UserScript==
// @name Niconico move frame
// @namespace https://abcang.net/
// @version 0.1
// @description move frame on niconico video to press arrow key
// @author ABCanG
// @match http://www.nicovideo.jp/watch/*
// @grant none
// ==/UserScript==
@abcang
abcang / .zshrc
Created April 9, 2016 10:33
ssh先の場合tmux自動起動するやつ。.zshrcとかに入れると便利。tmuxをデタッチするとssh終了するか聞かれるので便利
## ssh先の場合tmux自動起動
if [[ -n "${REMOTEHOST}${SSH_CONNECTION}" && -z "$TMUX" && -z "$STY" ]] && type tmux >/dev/null 2>&1; then
function confirm {
MSG=$1
while :
do
echo -n "${MSG} [Y/N]: "
read ans
case $ans in
[yY]) return 0 ;;