The tips and tricks below originally appeared as one of Google's "Testing on the Toilet" (TOTT) episodes.
This is a revised and augmented version.
I start every bash script with the following prolog:
| javascript:((_=>location.href='http://web.archive.org/web/*/'+location.href)()) |
| # Shows the number of AWS IPs | |
| curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[].ip_prefix' | xargs ruby -e "puts ARGV.reduce(0) { |acc, i| acc + 2**(32 - i.split('/')[1].to_i) }" |
| # Figure out where a method was defined | |
| object = Object.new | |
| puts object.method(:blank?).source_location | |
| # Opening a dependency from a project | |
| $ bundle open active_support | |
| return done ? foo(a) : bar(b); | |
| return done == false && exist == true | |
| ? foo(a) | |
| : bar(b); | |
| const baz = (a, b) => | |
| done ? foo(a) : bar(b); |
| const _ = require('lodash'); | |
| const map = _.map; | |
| const mapWith = (fn) => (list) => map(list, fn); | |
| // Bounding to a name | |
| ((diameter_fn) => | |
| console.log(diameter_fn(2)) //=> 6.2831853 | |
| )( | |
| ((PI) => |
| wget --limit-rate=200k --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U mozilla http://example.com | |
| # or | |
| download_site () { | |
| wget --limit-rate=200k --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U mozilla $1 | |
| } |
| curl wttr.in |
The tips and tricks below originally appeared as one of Google's "Testing on the Toilet" (TOTT) episodes.
This is a revised and augmented version.
I start every bash script with the following prolog:
blia Dec 22 14:43
форкни фетч еба
Iurii Plugatariov @strangeworks Sep 18 22:09
| #!/bin/bash | |
| init() { | |
| # Use ruby version specified in .ruby-version file | |
| rvm use $(cat .ruby-version) | |
| # Use Postgress 9.3 version on Codeship (port 5433) | |
| sed -i "s|5432|5433|" "config/database.yml" | |
| # Install gem dependencies |