Skip to content

Instantly share code, notes, and snippets.

View shishi's full-sized avatar
🏠
Working from home

Shigenobu Nishikawa shishi

🏠
Working from home
View GitHub Profile
@shishi
shishi / ssm_fzf.sh
Created March 23, 2023 10:26
ssm script with fzf
#!/bin/bash
set -e
usage() {
echo "USAGE: `basename $0` [Options]"
echo " ssm target selection using fzf"
echo ""
echo "Optinal Arguments:"
echo " All arguments excluded options pass to initial queries of fzf"
echo ""
@shishi
shishi / gist:181c4b95c464d0d688ec
Created November 23, 2015 10:13
AtomのKeybindngのバグ
# こう書くとctrl-aだけ書いたとおりになる
'atom-workspace atom-text-editor':
'ctrl-/': 'core:undo'
'atom-workspace atom-text-editor':
'ctrl-a': 'editor:move-to-beginning-of-line'
# こう書くと両方書いたとおりにならない
'atom-workspace atom-text-editor':
'ctrl-a': 'editor:move-to-beginning-of-line'
'atom-workspace atom-text-editor':
@shishi
shishi / gist:10732628
Created April 15, 2014 13:27
namespace
module Hoge
module Huga
@@hugahuga = 'hugahuga'
end
end
Hoge::Huga.hugahuga #=> 'hugahuga'
before do
@validators = []
User.validators.each { |v| @validators << v.class }
end
it { @validators.should include HogeValidator }
# 1
begin
key = SecureRandom.hex 5
end while self.find_by(migration_key: key)
key
# 2
key = SecureRandom.hex 5
if User.find_by(migration_key: key)

Docker 虎の巻

何故Dockerを使うべきか

Why Should I Care (For Developers)

"Dockerが面白いのはシンプルな環境に隔離性と再現性をもたらしてくれることだ.ランタイムの環境を一度作れば、パッケージにして別のマシンでも再利用することできる.さらに,すべてはホスト内の隔離された環境で行われる(VMのように).最も素晴らしい点は,シンプルかつ高速であることだ."

@shishi
shishi / file0.txt
Created October 10, 2013 05:46
Linux で生成される /etc/password の hash を手元で生成する方法 ref: http://qiita.com/shishi@github/items/46808113b929e985e97d
python -c "import crypt, getpass, pwd; print crypt.crypt('hogehoge', '\$6\$SALTdayo\$')"
@shishi
shishi / skype
Created October 7, 2013 07:12 — forked from orangain/skype
#!/bin/bash
#
# Init file for daemonized Skype service
#
### BEGIN INIT INFO
# Provides: skype
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
public interface MessageStrategy {
public void sendMessage();
}
public abstract class AbstractStrategyFactory {
public abstract MessageStrategy createStrategy(MessageBody mb);
}
public class MessageBody {
Object payload;
@shishi
shishi / helm-for-document.el
Created December 18, 2012 11:02
Emacs 実践入門の anything-for-document が便利だったので helm 用に作りなおした!
;; helm-for-document
(require 'helm-elisp)
(setq helm-for-document-sources-info
(list
helm-c-source-info-emacs
helm-c-source-info-elisp
helm-c-source-info-gnus
helm-c-source-info-pages
helm-c-source-info-org
helm-c-source-info-cl))