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
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 |
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
# 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. | |
# |
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 '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) |
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
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' | |
} |
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 'pry' | |
class Queens | |
attr_reader :white, :black | |
def initialize | |
@board = build_board | |
@black = current_position('w') | |
@white = current_position('b') | |
end | |
def build_board |
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
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 |
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
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 |
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 'pp' | |
require 'pry' | |
require 'csv' | |
class Importer | |
def self.get(filename) | |
violations = [] | |
CSV.foreach(filename, headers: true) do |csv| | |
violations << Violation.new( | |
csv[0], |
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 'rubygems' | |
require 'csv' | |
require 'json' | |
require 'pry' | |
require 'oauth' | |
consumer_key = '' | |
consumer_secret = '' | |
token = '' | |
token_secret = '' |
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 Car | |
def initialize(color, owner, cylinders) | |
@color = color | |
@owner = owner | |
@cylinders = cylinders | |
end | |
def color | |
@color | |
end |