start new:
tmux
start new with session name:
tmux new -s myname
| begin | |
| require 'bundler/inline' | |
| require 'bundler' | |
| require 'pry' | |
| require 'pry-byebug' | |
| rescue LoadError => e | |
| STDERR.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
| raise e | |
| end |
| // Automatically clicks the "Remove" button for all the advertisers | |
| // that are showing from this page: https://www.facebook.com/ads/preferences/?entry_product=ad_settings_screen | |
| // under the "Advertisers who you've interacted with" (who I actually have never | |
| // interacted with), "Who use a contact list added to facebook" (that they likely | |
| // bought 2nd hand because I've never done business with them) | |
| // | |
| // Click the "More" button multiple times to display them all, then run this script | |
| var buttons = document.querySelectorAll("[data-tooltip-content='Remove']");for (i = 0; i< buttons.length; i++) { buttons[i].click();}; |
| #!/bin/sh -eu | |
| # This file goes in .git/hooks/post-receive | |
| if git diff-tree --name-status -t -r --root HEAD | grep -q 'development.sql' | |
| then | |
| echo "Your db/data/development.sql file changed. You may want to run rails gs:load" | |
| fi |
| # Don't run this unless you know why you're running this | |
| gem outdated | awk '{print $1}' | xargs gem update $1 |
| fib = -> { Enumerator.new { |y| a = b = 1; loop { y << a; a, b = b, a + b } } } | |
| puts fib.call.take(20) | |
| x = fib.call | |
| x.next => 1 | |
| x.next => 1 | |
| x.next => 2 | |
| ... | |
| x.next => 13 |
| # Append this alias to your .zshrc or .bashrc | |
| # | |
| # Run `guardme` from any exercise directory to start guard | |
| # with your custom Guardfile | |
| alias guardme="guard --guardfile ~/exercism/ruby/Guardfile" |
| "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW". | |
| chars. | |
| chunk_while { |before, after| before == after }. | |
| reduce(String.new) { |memo, group| memo << "#{group.size}#{group.first}" } | |
| rle = -> (str) { str.chars.chunk_while{ |b, a| b == a }.reduce(""){ |m, g| m << g.length.to_s << g.first } } | |
| rle.call("WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW") |
| # Block things on LinkedIn with uBlock Origin that LinkedIn won't let you block | |
| # Choose "Options" in uBlock Origin with a right-click, and add these to | |
| # "My filters" | |
| # ADDING YOUR OWN FILTERS | |
| # | |
| # Using Linkedin.com as an example | |
| # | |
| # 1. Open up the webpage | |
| # 2. Find some text you want to block |
| # Mirror CI/CD version bundler with your Gemfile.lock version | |
| gem install bundler --no-document --version $(tail -n 1 Gemfile.lock) | sed -e 's/^[[:space:]]*//' |