A guide for reviewing code and having your code reviewed.
- Accept that many programming decisions are opinions. Discuss tradeoffs, which you prefer, and reach a resolution quickly.
var node = { | |
value: -120, | |
left: { | |
value: -2120, | |
left: { value: -20 }, | |
right: { value: -30 } | |
}, | |
right: { | |
value: -20, | |
left: {value: 20 }, |
#!/bin/sh | |
# prerequisite: sudo su - postgres | |
CONFIGURATION_FILE="/etc/postgresql/9.4/main/pg_hba.conf" | |
CURRENT_IP=$(last -i | grep "still logged" | awk '{ print $3 }') | |
IPV4_REGEX="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b" | |
if [ ! -f "$CONFIGURATION_FILE" ]; then | |
echo "File not found: $CONFIGURATION_FILE" | |
exit 1 |
// do not use result cache, nor line and column tracking | |
{ var indentStack = [], indent = ""; } | |
start | |
= INDENT? lines:( blank / line )* | |
{ return lines; } | |
line | |
= SAMEDENT line:(!EOL c:. { return c; })+ EOL? |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
var clickElement = function(element) { | |
if (!element) { | |
return; | |
} | |
var event = document.createEvent('HTMLEvents'); | |
event.initEvent('click', true, true); | |
event.eventName = 'click'; | |
element.dispatchEvent(event); | |
}; |
(function(Factory) { | |
function isInteger(n) { | |
return typeof n === 'number' && | |
isFinite(n) && | |
n > -9007199254740992 && | |
n < 9007199254740992 && | |
Math.floor(n) === n; | |
} | |
var SHA_CHARS = '0123456789abcdef'; |
def message(message, tries) | |
if tries > 0 | |
puts message + " Please try again. You have #{tries} tries remaining." | |
else | |
puts "Game over! :(" | |
end | |
end | |
min = 1 | |
max = 100 |