start new:
tmux
start new with session name:
tmux new -s myname
# Generates docs | |
gem list | awk '{ print $1 }' | xargs gem rdoc | |
# Starts server | |
gem server |
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"definitions": { | |
"attributes": { | |
"additionalProperties": false, | |
"description": "Members of the attributes object (\"attributes\") represent information about the resource object in which it's defined.", | |
"patternProperties": { | |
"^(?!relationships$|links$)\\w[\\w_-]*$": { | |
"description": "Attributes may contain any valid JSON value." | |
} |
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") |