sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| class Integer | |
| N_BYTES = [42].pack('i').size | |
| N_BITS = N_BYTES * 16 | |
| MAX = 2 ** (N_BITS - 2) - 1 | |
| MIN = -MAX - 1 | |
| end | |
| p Integer::MAX #=> 4611686018427387903 | |
| p Integer::MAX.class #=> Fixnum | |
| p (Integer::MAX + 1).class #=> Bignum |
| #!/bin/sh | |
| apk add stunnel redis openssl gcc | |
| # Remember to replace the host and port | |
| cat > /etc/stunnel/redis-cli.conf <<EOF | |
| fips = no | |
| setuid = root | |
| setgid = root | |
| pid = /var/run/stunnel.pid |
| # .git/hook/pre-commit | |
| #!/bin/sh | |
| # | |
| # Check for ruby style errors | |
| red='\033[0;31m' | |
| green='\033[0;32m' | |
| yellow='\033[0;33m' | |
| NC='\033[0m' |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
| sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'` |
| # http://jkfill.com/2012/12/08/automatic-code-reloading-in-rails-console | |
| # put this in config/initializeers/irb_reloading.rb | |
| if defined?(IRB::Context) && !defined?(Rails::Server) && Rails.env.development? | |
| class IRB::Context | |
| def evaluate_with_reloading(line, line_no) | |
| reload!(true) | |
| evaluate_without_reloading(line, line_no) | |
| end |
As configured in my dotfiles.
start new:
tmux
start new with session name: