Skip to content

Instantly share code, notes, and snippets.

@ToQoz
ToQoz / 0_README
Last active October 24, 2023 15:22
Cmd-Z -> Undo, Cmd-Shift-Z -> Redo in zsh. 1. bindkey in zsh 2. remap in keyremap4macbook
Cmd-Z -> Undo, Cmd-Shift-Z -> Redo in zsh.
1. bindkey in zsh
2. remap in keyremap4macbook
@ToQoz
ToQoz / js_typeof_instanceof.md
Created November 21, 2011 02:20
typeof と instanceof について

typeof

有用なとき

typeof foo !== 'undefined'

有用でないとき

上記以外.

[上記以外が有用でない理由]

typeofの戻り値は仕様で定義されていないものを返します。よって、実装によって別の結果になる事がある

#!/usr/bin/env ruby
# Usage
# $ htpasswd.rb 'your_usrename', 'your_password'
# UseCase
# Generate htpasswd for nginx without apache tools.
require "base64"
username, password = ARGV
salt = Base64.encode64((("a".."z").to_a + ("A".."Z").to_a + (0..9).to_a).shuffle[0..7].join)
puts "#{username}:#{password.crypt(salt)}"
cat notebook.ipynb | jq -r '.cells[] | select(.cell_type == "code") | select(.source != "") | .source + "\n"' | sed -e 's/\( *\)%.* /\1/'

install:

$ go get github.com/google/codesearch/cmd/...

generate indexes:

$ cindex /usr/include /usr/local/include $HOME/_go/src $HOME/_dev
@ToQoz
ToQoz / 0_SVGKit-issue.md
Last active November 13, 2017 09:32
SVGKit-issue

多分 ``  に fill や `style="fill:` の指定が動かない

$ sudo defaults write com.apple.loginwindow LoginHook /path/to/script
select timestamp 'epoch' + CAST(ts AS BIGINT)/1000 * interval '1 second' from (select 1498783941705 AS ts);
{
"libs": [
"browser"
],
"plugins": {
"node": {},
"es_modules": {},
"node_resolve": {}
}
}