x || !x == true # Tautology
x && !x == false # Contradiction
true && x == x # Identity law
false || x == x # Identity law
true || x == true # Nullification law
false && x == false # Nullification law
x && x == x # Idempotent law
x || x == x # Idempotent law
This file contains hidden or 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 jruby | |
require_relative '../lib/schrute' | |
require 'csv' | |
require 'thread_safe' | |
java_import java.util.concurrent.Callable | |
java_import java.util.concurrent.Executors | |
java_import java.util.concurrent.FutureTask |
This file contains hidden or 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
PS1='\[\033[31m\]\w\[\033[0m\] $ ' | |
export EDITOR=vim | |
alias st='git status -sb' |
This file contains hidden or 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
#!/bin/bash -x | |
echo "LANG=\"en_US.UTF-8\"" >> /etc/environment | |
echo "LANGUAGE=\"en_US.UTF-8\"" >> /etc/environment | |
echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/environment | |
source /etc/environment | |
apt-get install -y --reinstall locales | |
locale-gen en_US.UTF-8 |
This file contains hidden or 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 bash -x | |
apt-get -y update | |
# ------------------------------- | |
# Based on bootstrap-ubuntu-12-04 | |
# https://raw.github.com/fesplugas/rbenv-bootstrap/master/bin/rbenv-bootstrap-ubuntu-12-04 | |
# Update sources: | |
apt-get -y update |
This file contains hidden or 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
Aaron Bedra | |
Aaron Holbrook | |
Aaron Kalin | |
Adam Grandy | |
Adewale Oshinye | |
Amy Kinney | |
Andrea Magnorsky | |
Andy Lester | |
Angelique Martin | |
Anthony Zinni & Jon Buda & Shay Howe |
This file contains hidden or 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
def self.models | |
ActiveRecord::Base | |
.send(:subclasses) | |
.map { |model| model.name.constantize } | |
end | |
def self.controllers | |
Rails.application.routes.routes | |
.select { |r| r.defaults[:controller].present? } | |
.uniq { |r| r.defaults[:controller] } |
This file contains hidden or 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
# The example I tweeted about preferring the more verbose if..then..else..end | |
# over ternary operations in Ruby got mangled by Twitter. | |
# So when my tweet showed everything on one line my message got muddled. | |
# The reformatting of my tweet also looked like I was trying to evaluate | |
# an expression that returned literally "true" or "false" which wasn't the case. | |
# What I wanted to show was that many people write IF/ELSE statements as | |
# ternary operations. |
Vimcov runs a Ruby script and opens Vim marking the lines that were actually run.
This could be useful when debugging long methods with lots of branching -- instead of abusing puts
, you can just use Vimcov and you're good to go.
It runs only in Ruby 1.9.x.
Future versions will include more tight integration with test runs or Rails or whatever.
This file contains hidden or 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 | |
require 'rubygems' | |
require 'bundler' | |
require 'fileutils' | |
require 'net/http' | |
require 'net/https' | |
require 'uri' | |
TMP_DIR = "/tmp/gems" |
NewerOlder