Skip to content

Instantly share code, notes, and snippets.

@knishioka
knishioka / gist:9eaeb778012c17b70a24eeaca556e9e9
Created May 6, 2019 11:39
MacでのLocalStackの起動
TMPDIR=/private$TMPDIR SERVICES=lambda:4574,s3:4572 localstack start --docker
@knishioka
knishioka / install-emacs-packages.sh
Last active August 25, 2022 00:30
コマンドラインからemacsのpackageのインストール
emacs --batch --eval "(require 'package)" \
--eval "(add-to-list 'package-archives '(\"melpa\" . \"https://melpa.org/packages/\") t)" \
--eval "(package-refresh-contents)" \
--eval "(package-initialize)" \
--eval "(package-install 'flymake-python-pyflakes))" \
--eval "(package-install 'guru-mode))" \
--eval "(package-install 'helm))"
unbind-key C-b
set-option -g prefix C-t
bind-key C-t send-prefix
set-option -g history-limit 2000
set-option -g status-fg white
set-option -g status-bg black
setw -g window-status-current-style "bg=blue,fg=white"
@knishioka
knishioka / set-intern-environment.sh
Last active November 14, 2018 09:18
set-intern-environment
# install ohmyzsh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
sed -i -e "s/robbyrussell/simple/" ~/.zshrc
# install pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo '# pyenv' >> ~/.zshrc
echo 'export PYENV_ROOT=\"\$HOME/.pyenv\"' >> ~/.zshrc
echo 'export PATH=\"\$PYENV_ROOT/bin:\$PATH\"' >> ~/.zshrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval \"\$(pyenv init -)\"\nfi' >> ~/.zshrc
@knishioka
knishioka / .emacs
Last active February 19, 2019 13:19
.emacsの雛形
; Package
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
; highlight brackets
(show-paren-mode 1)
; highlight region
(transient-mark-mode t)
@knishioka
knishioka / set-intern-emacs.sh
Last active November 14, 2018 09:11
drill instructor for other user
mkdir -p ~/.emacs.d/drill-instructor
wget https://raw.githubusercontent.com/knishioka/emacs-drill-instructor/master/drill-instructor.el -P ~/.emacs.d/drill-instructor/
wget https://gist.githubusercontent.com/knishioka/d49cd72d7fa39b41440e0ed9e8e4b579/raw/70637d26d332d127a100f1aa53fdd57b0fbc1c9c/.emacs -P ~/
@knishioka
knishioka / operators_100.rb
Last active August 29, 2015 14:07
四則演算を組み合わせて100なる組み合わせを抽出するプログラム
# 左から計算できるものしか抽出できない
## 実行例
# ruby sample.rb 1 2 8 8 8
# ((((1) + 8) / 2) + 8) * 8
# ((((8) + 1) / 2) + 8) * 8
require 'rational'
numbers = ARGV.map(&:to_r)
operators = ["+", "-", "*", "/"]
rails g rspec:install
spork --bootstrap
guard init spork
guard init rspec
require 'open-uri'
require 'rexml/document'
def follow_list(name)
xml = nil
list = Array.new
url = "http://twitter.com/statuses/friends/#{name}.xml"
open(url) {|f| xml = REXML::Document.new f.read}
xml.elements.each("/users/user/screen_name"){|element|
list.push element.text