Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / gist:45d3c8b9ed9080364d02217fba583a73
Created April 4, 2017 16:25
adblockでブラックリスト方式にするためのカスタムフィルタ
@@*$document,domain=~example.com|~example.jp|~example.org
### 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 / 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);
@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 / 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:217d5e082b4188cdf78098d21429c448
Last active September 28, 2017 01:57
DeliveryWorkerの時間を測ってみた
Sep 28 10:56:04 testingmstdn bundle[29551]: music.pawoo.net 0.04089464992284775
Sep 28 10:56:04 testingmstdn bundle[29551]: https://mstdn.maud.io/inbox 0.03909538802690804
Sep 28 10:56:04 testingmstdn bundle[29551]: qiitadon.com 0.055527453077957034
Sep 28 10:56:04 testingmstdn bundle[29551]: https://mdx.ggtea.org/inbox 0.05250926804728806
Sep 28 10:56:04 testingmstdn bundle[29551]: https://pawoo.net/inbox 0.0849727860186249
Sep 28 10:56:04 testingmstdn bundle[29551]: https://mstdn.jp/inbox 0.06941196299158037
Sep 28 10:56:04 testingmstdn bundle[29551]: https://edge.mstdn.jp/inbox 0.12433904805220664
Sep 28 10:56:04 testingmstdn bundle[29551]: https://friends.nico/inbox 0.13494027708657086
Sep 28 10:56:04 testingmstdn bundle[29551]: https://mastodon.matcha-soft.com/inbox 0.07789720501750708
Sep 28 10:56:04 testingmstdn bundle[29551]: https://taruntarun.net/inbox 0.051792427082546055
REQUEST GET /web/accounts/689 20
SQL (0001.12ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [1, 1]
SQL (0000.30ms) SELECT "session_activations".* FROM "session_activations" WHERE "session_activations"."session_id" = $1 LIMIT $2 ["せっしょんあいでぃー", 1]
SQL (0000.42ms) SELECT "web_push_subscriptions".* FROM "web_push_subscriptions" WHERE "web_push_subscriptions"."id" = $1 LIMIT $2 [3, 1]
SQL (0000.48ms) SELECT "oauth_access_tokens".* FROM "oauth_access_tokens" WHERE "oauth_access_tokens"."id" = $1 LIMIT $2 [21, 1]
SQL (0000.57ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."uri" = $1 LIMIT $2 ["https://edge.mstdn.jp/users/nullkal", 1]
SQL (0000.22ms) SELECT "session_activations".* FROM "session_activations" WHERE "session_activations"."session_id" = $1 LIMIT $2 ["せっしょんあいでぃー", 1]
SQL (0000.25ms) SELECT "web_push_subscriptions".* FROM "web_push_subscriptions" WHERE "web_push_subscriptions"."id" = $1 LIMIT $2 [3, 1]
SQL (0000.24ms) SELECT "oauth_access_tokens".* FROM "oauth_access_t
@abcang
abcang / azpainter.diff
Last active December 28, 2020 12:22
azpainter.diff
diff --git desktop/icons/hicolor/scalable/apps/azpainter.svg desktop/icons/hicolor/scalable/apps/azpainter.svg
index 023e08a..d2dc659 100755
--- desktop/icons/hicolor/scalable/apps/azpainter.svg
+++ desktop/icons/hicolor/scalable/apps/azpainter.svg
@@ -167,7 +167,7 @@
x="20.971798"
y="560.68152"
sodipodi:insensitive="true"
- ry="44.807964"
+ ry="0"