This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Start with a clean working directory | |
2. current branch is always the target | |
3. investigate conflicts with git diff (or git mergetool) | |
4. edit conflicting files | |
5. git add file | |
6. git commit | |
Aborting a merge: | |
git reset --hard HEAD # prior to merge commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
us = user cpu | |
sy = system cpu | |
id = idle CPU (high is good) | |
wa = I/O wait (either RAM or disk. High here means prob not a cpu issue) | |
Mem: free + Swap cached = actual free RAM | |
iostat | |
# | |
Load average is the last: 1, 5 and 15 minutes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.redis.get(key) | |
Rails.redis.set(key, value) | |
Rails.redis.expire(key, 1.hour) | |
Rails.redis.del(key) | |
Rails.redis.sadd(set_name, value) | |
Rails.redis.srem(set_name, key) | |
Rails.redis.sismember(set_name, value) # boolean test to see if val exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In spec_helper.rb | |
RSpec.configure do |config| | |
.... | |
rubocop_output = `rubocop` | |
print rubocop_output | |
fail "RuboCop Errors" unless rubocop_output.match(/files inspected, no offenses detected/) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
rescue | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#> lower_bound upper_bound fdo_count_to_suspend_on | |
#> 1 0 18 2 | |
#> 2 19 86 3 | |
#> 3 87 180 4 | |
#> 4 181 310 5 | |
#> 5 311 inf 6 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Commands: | |
docker run hello-world # run container | |
docker run -d -p 4000:80 hello-world # run in the background on port 4000 | |
docker container stop CONTAINER_ID # stop container id | |
docker stop $(docker ps -a -q) # stop all containers | |
docker image ls # list images | |
docker container ls --all # list all containers | |
docker build -t appname . # build the app in currect dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.send(var) | |
request = gets | |
if ticket.respond_to?(request) | |
puts ticket.send(request) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string = mystring | |
string[0].chr | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Party | |
def full_party? | |
self == 8? true : false | |
end | |
end | |
include Party | |
class People |
NewerOlder