Skip to content

Instantly share code, notes, and snippets.

@azu
azu / lv5.rb
Created October 28, 2013 13:56
Homebrew formula : iv / lv5
require 'formula'
class Lv5 < Formula
homepage 'https://github.com/Constellation/iv'
url 'https://github.com/Constellation/iv/archive/69f89912a7c9160da1484347253015af782f9ac8.zip'
head 'https://github.com/Constellation/iv.git'
sha1 '7ea9bdd6394ac49d6293d5be34c7aa9af5d52067'
version '1.0'
depends_on 'cmake' => :build
@azu
azu / strftime.js
Created June 3, 2011 06:01 — forked from mjackson/strftime.js
A strftime implementation for JavaScript Date objects.
// https://gist.github.com/765200
var strftime;
strftime = (function () {
var zeropad = function (n) {
return n > 9 ? n : '0' + n;
};
var shortDays = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
@azu
azu / Pre-hijacking Attacks.md
Last active November 28, 2023 02:22
Pre-hijacking Attacksのメモ書きやSSO/パスワードリセット/アカウントマージ周りのチェックリスト

Pre-hijacking Attacksについてのメモ書きです。 元の論文と記事は次のページを読んでください。

Pre-hijacking Attacks はメールアドレスの確認をしないでアカウントを作れるサービスという前提があります。

アカウント作成からそのまま機能を利用できるようにすることで、利用体験をよくするための施策として、メールアドレスの確認のステップを後回し またはしないサービスがあります。

@azu
azu / 英語 文書 翻訳 読む ツール まとめ.md
Last active November 17, 2023 16:11
英語の文書を翻訳して読むときのツールのまとめ
@azu
azu / post-commit
Last active October 14, 2023 07:16
Gitメモ: メモをコミットして作業ツリー自体はメモを書く直前に戻すcommit -hook
# 📝 [Note] Mode -- if commit message starts with "📝" or includes "[Note]"
IS_NOTE_MODE=$(git log -1 --pretty=%B | grep -E '^(📝|\[Note\])')
if [[ -n "${IS_NOTE_MODE}" ]]; then
# メモの作業内容を戻すコミットをする
headSHA=$(git rev-parse HEAD)
git revert --no-commit HEAD
git ls-tree -r --name-only HEAD | xargs git commit -m "↩️ ${headSHA}" --
# メモを書く直前の状態に作業内容を戻す
git revert --no-commit HEAD
# terminal notification
@azu
azu / sql-execute-os-command.md
Last active October 7, 2023 00:42
各SQLサーバでOSコマンドを実行する方法
@azu
azu / Medium: remove location hash.user.js
Created December 2, 2015 15:05
Medium: remove location hash
// ==UserScript==
// @name Medium: remove location hash
// @namespace http://efcl.info/
// @description Remove location hash from medium
// @include https://medium.com/*#*
// @version 1
// @grant none
// ==/UserScript==
function removeLocationHash(){
@azu
azu / tab.json
Created July 23, 2017 11:47
Change Tab + I/J/K/L to Arrow Keys - Karabiner-Elements.
{
"title": "Tab + HJKL",
"rules": [
{
"description": "Change Tab to fake modified key",
"manipulators": [
{
"from": {
"key_code": "tab"
},
@azu
azu / github.js
Created May 19, 2018 12:44
Rename File via GitHub API. Not work correctly.(can not remove)
/**
* @param {*} robot
* @param {string} owner
* @param {string} repo
* @param {string} branch
* @param {(item:*): item) renameItem
* @returns {Promise<void>}
*
* https://medium.com/@obodley/renaming-a-file-using-the-git-api-fed1e6f04188
* http://www.levibotelho.com/development/commit-a-file-with-the-github-api/
@azu
azu / Bluesky: auto refresh.user.js
Last active July 27, 2023 09:48
Bluesky: auto refresh
// ==UserScript==
// @name Bluesky: auto refresh
// @namespace https://efcl.info
// @match https://bsky.app/*
// @grant none
// @version 1.0
// @author azu
// @description Auto Refresh when notifications is shown
// ==/UserScript==
const origSetInterval = window.setInterval;