This file contains 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
RSpec.configure do |config| | |
config.before :suite do | |
# set up a global cleaning strategy | |
DatabaseCleaner.clean_with(:truncation) | |
# AR specific strategy | |
DatabaseCleaner[:active_record].strategy = :truncation | |
# Explicitly tell DatabaseCleaner what connection is AR | |
DatabaseCleaner[:active_record, connection: :pediafed_test] |
This file contains 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
require 'github_api' | |
require 'io/console' | |
class Teams < Thor | |
include Thor::Actions | |
desc "ls", "list users in an organization" | |
def ls(org) | |
connenction = connect | |
members = connenction.orgs.members.list org |
This file contains 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
class Aggregator | |
def initialize(target_filename, output_filename, pattern, output_file_type=nil) | |
@target_filename = target_filename | |
@output_filename = output_filename | |
@pattern = pattern | |
@output_file_type = output_file_type || "csv" | |
end | |
def run | |
open_files |
This file contains 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
require "tempfile" | |
require "fileutils" | |
require "csv" | |
require "time" | |
# -*- coding: utf-8 -*- | |
rents = "/Users/seanjw/Library/Thunderbird/Profiles/gdg1f8hw.default/ImapMail/imap.googlemail.com/Parents" | |
output = "/Users/seanjw/Dropbox/Programming-Languages/Ruby/rents-email-dates.txt" | |
odd_output = "/Users/seanjw/Dropbox/Programming-Languages/Ruby/odd-rents-dates.txt" |
This file contains 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
# Seans Theme | |
if patched_font_in_use; then | |
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="⮂" | |
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="⮃" | |
TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD="⮀" | |
TMUX_POWERLINE_SEPARATOR_RIGHT_THIN="⮁" | |
else | |
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="◀" | |
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="❮" |
This file contains 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
PHRASES=( | |
"A leader leads by example not by force. \n- Sun Tzu" | |
"All warfare is based on deception. \n- Sun Tzu" | |
"To know your Enemy, you must become your Enemy.\n- Sun Tzu" | |
"It is said that if you know your enemies and know yourself, you will not be imperilled in a hundred battles; if you do not know your enemies but do know yourself, you will win one and lose one; if you do not know your enemies nor yourself, you will be imperilled in every single battle.\n- Sun Tzu" | |
"He who knows when he can fight and when he cannot will be victorious.\n- Sun Tzu" | |
"Subtle and insubstantial, the expert leaves no trace; divinely mysterious, he is inaudible. Thus he is master of his enemy's fate.\n- Sun Tzu" | |
"The key is to keep company only with people who uplift you, whose presence calls forth your best.\n- Epictetus" | |
"There is only one way to happiness and that is to cease worrying about things which are beyond the power of our will.\n- Epictetus" | |
"When you are offended at any man's fault, turn to yourself and study your ow |
This file contains 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
(defun assign-group-from-hash (hash keys) | |
"creates a series of instance variable assignments in the style @key = hash.fetch(:key)" | |
(interactive "sHash Name: \nsKeys(separated by a space): ") | |
(let ((hash-keys (split-string keys))) | |
(mapc (lambda (key) (insert (format "@%s = %s.fetch(:%s)\n" key hash key))) hash-keys) | |
) | |
) |
This file contains 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
(global-set-key [f2] 'toggle-selective-display-at-depth) | |
(defun toggle-selective-display-at-depth (column) | |
(interactive "P") | |
(set-selective-display | |
(if selective-display nil (or column 3)))) |
This file contains 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
(global-set-key [f2] 'toggle-selective-display-at-depth) | |
(defun toggle-selective-display-at-depth (column) | |
(interactive "P") | |
(set-selective-display | |
(if selective-display nil (or column 3)))) |
This file contains 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
require "benchmark" | |
class KWBM | |
attr_reader :foo, :baz | |
def initialize(foo: "bar", baz: "biz") | |
@foo = foo | |
@baz = baz | |
end | |
def call |