gem install tmuxinator
# File: ~/.tmuxinator/project-name.yml
name: project-name
# After building a new Linode Ubuntu 13.04 image... | |
ssh root@linode-123 | |
# ... | |
uname -a | |
# Linux li348-235 3.12.9-x86_64-linode37 #1 SMP Mon Feb 3 10:01:02 EST 2014 x86_64 x86_64 x86_64 GNU/Linux | |
apt-get update | |
apt-get install -y linux-virtual grub-legacy-ec2 |
## | |
## Prefer mongodump/mongorestore instead of mongoexport/mongoimport, | |
## as it will "export" additional metadata, like indexes etc. | |
## | |
### Mongodump example | |
# Required: host, db, collection, out | |
# Optional: query (limit results) | |
mongodump --host mongodb1.example.net \ |
# newly created stacks should be empty | |
# after one push stack size should be one | |
# after one push and one pop should be empty | |
# when pushed past limit stack overflows | |
# when empty stack popped should throw underflow | |
# when one is pushed one is popped | |
# when one and two are pushed two and one are popped | |
# when creating stack with negative size should throw illegal capacity | |
# when creating stack with zero capacity any push should overflow | |
# when one is pushed one is on top |
#!/usr/bin/env ruby | |
# Solved from https://docs.google.com/forms/d/1h6LtvCS3tVosk1-dbEsX54DsLxE6Xg9tTWUT2C-JqMk/viewform | |
hidden_string = 'bddpvout ejggfsfou gps qbttxpse b sfvtf opu Ep' | |
def rotr_word(word, number) | |
letters = word.split('') | |
.map do |letter| | |
(letter.ord + number).chr |
I hereby claim:
To claim this, I am signing this object:
# | |
# Playing with ephemeral gem | |
# | |
# - https://github.com/CoralineAda/ephemeral/ | |
class Base | |
include Ephemeral::Base | |
def initialize(args={}); args.each{|k,v| self.send("#{k}=", v)}; end | |
end |
Inspired by this tip
Example of upgrading PostgreSQL from 9.3 to latest 9.5
const todo = (state, action) => { | |
switch (action.type) { | |
case 'ADD_TODO': | |
return { | |
id: action.id, | |
text: action.text, | |
completed: false | |
}; | |
case 'TOGGLE_TODO': | |
if (state.id !== action.id) { |