Skip to content

Instantly share code, notes, and snippets.

View allcentury's full-sized avatar
🎈

Anthony Ross allcentury

🎈
View GitHub Profile
###########################
# Configuration
###########################
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 5000
# This file allows you to override various Teaspoon configuration directives when running from the command line. It is not
# required from within the Rails environment, so overriding directives that have been defined within the initializer
# is not possible.
#
# Set RAILS_ROOT and load the environment.
ENV["RAILS_ROOT"] = File.expand_path("../../", __FILE__)
require File.expand_path("../../config/environment", __FILE__)
# Provide default configuration.
#
require 'set'
require 'benchmark'
def reject_this_set(list, ids)
order_set = Set.new
ids.each { |i| order_set << i }
list.reject { |val| order_set.include?(val[:order_id]) }
end
def reject_this(list, ids)
@allcentury
allcentury / factory_girl.rb
Created November 13, 2014 16:50
FactoryGirl
it 'user can be invited twice which causes new token generation' do
user2 = create(:user, email: "already_invited@validic.com")
token = user2.invitation_token
date = user2.invitation_created_at
count = User.count
post :create, invitation: { email: 'already_invited@validic.com',
organization_id: @org.org_id,
role: 'standard'
}
require 'pry'
class Queens
attr_reader :white, :black
def initialize
@board = build_board
@black = current_position('w')
@white = current_position('b')
end
def build_board
set encoding=utf-8
" load up pathogen and all bundles
call pathogen#infect()
call pathogen#helptags()
syntax on " show syntax highlighting
filetype plugin indent on
set autoindent " set auto indent
set ts=2 " set indent to 2 spaces
set encoding=utf-8
" load up pathogen and all bundles
call pathogen#infect()
call pathogen#helptags()
syntax on " show syntax highlighting
filetype plugin indent on
set autoindent " set auto indent
set ts=2 " set indent to 2 spaces
require 'pp'
require 'pry'
require 'csv'
class Importer
def self.get(filename)
violations = []
CSV.foreach(filename, headers: true) do |csv|
violations << Violation.new(
csv[0],
require 'rubygems'
require 'csv'
require 'json'
require 'pry'
require 'oauth'
consumer_key = ''
consumer_secret = ''
token = ''
token_secret = ''
class Car
def initialize(color, owner, cylinders)
@color = color
@owner = owner
@cylinders = cylinders
end
def color
@color
end