-
Understand and accept that you will make mistakes. The point is to find them early, before they make it into production. Fortunately, except for the few of us developing rocket guidance software at JPL, mistakes are rarely fatal in our industry. We can, and should, learn, laugh, and move on.
-
You are not your code. Remember that the entire point of a review is to find problems, and problems will be found. Don’t take it personally when one is uncovered.
-
No matter how much "karate" you know, someone else will always know more. Such an individual can teach you some new moves if you ask. Seek and accept input from others, especially when you think it’s not needed.
-
Don’t rewrite code without consultation. There's a fine line between "fixing code" and "rewriting code." Know the difference, and pursue stylistic changes within the framework of a code review, not as a lone enforcer.
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
# frozen_string_literal: true | |
source "https://rubygems.org" | |
gem "prawn" | |
gem "prawn-qrcode" | |
gem "matrix" |
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
# {{date}} | |
[[{{Yesterday}}|<]] | {{date}} | [[{{Tomorrow}}|>]] | |
## Gratitude | |
- I am grateful for: | |
- ... | |
## Target(s) | |
- [ ] Goal |
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
aws ec2 describe-instances --profile=chaserx | jq '.Reservations[].Instances[] | { instance: .InstanceId, publicip: .PublicIpAddress, privateip: .PrivateIpAddress, publicDNS: .PublicDnsName, tags: .Tags, state: .State.Name }' |
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
# awesome print | |
begin | |
require 'awesome_print' | |
AwesomePrint.irb! | |
rescue LoadError => err | |
warn "Couldn't load awesome_print: #{err}" | |
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
#!/usr/bin/env ruby -wKU | |
# gems required: | |
# - nokogiri | |
# - awesome_print | |
# - open-uri-cached | |
require 'nokogiri' | |
require 'open-uri' | |
require 'awesome_print' |
I hereby claim:
- I am chaserx on github.
- I am chaserx (https://keybase.io/chaserx) on keybase.
- I have a public key whose fingerprint is C680 33F7 E216 251D F7E5 C95E A91D 479C 048F 7ACA
To claim this, I am signing this object:
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
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'uri' | |
require 'mechanize' | |
require 'pathname' | |
# inspired by: http://stackoverflow.com/a/7933585/281699 | |
class Downloader | |
def make_absolute href, root |
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
// Random Heart | |
// random hearts for you | |
int number = 128; | |
float x; | |
float y; | |
float a; | |
// http://www.colourlovers.com/palette/1099931/be_my_valentine | |
color[] palette = { color(247,162,185), color(242,100,122), color(221,38,32), color(146,2,0) }; |
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
REGEX = /^(?<type>.{1})(?<mode>\S+)\s+(?<number>\d+)\s+(?<owner>\S+)\s+(?<group>\S+)\s+(?<size>\d+)\s+(?<mod_time>.{12})\s+(?<filename>.+)$/ | |
def delete_directory_contents(path, verbose = true) | |
# files = @ftp_conn.nlst(path) | |
# files.each do |file| | |
# if directory?("#{path}/#{file}") | |
# delete_directory_contents "#{path}/#{file}" | |
# @ftp_conn.rmdir("#{path}/#{file}") | |
# else | |
# @ftp_conn.delete("#{path}/#{file}") | |
# end |
NewerOlder