Let's create. I'm making dahl to eat.
When Thursday 19th July, 6:30pm to 10
Where 17th & Harrison, SF (I'll send you exact instructions.)
What Code, learning, words, reality, whatever
package com.squareup.alcatraz.auth; | |
import com.google.common.base.Optional; | |
import com.unboundid.ldap.sdk.Filter; | |
import com.unboundid.ldap.sdk.LDAPConnection; | |
import com.unboundid.ldap.sdk.LDAPException; | |
import com.unboundid.ldap.sdk.ResultCode; | |
import com.unboundid.ldap.sdk.SearchRequest; | |
import com.unboundid.ldap.sdk.SearchResult; | |
import com.unboundid.ldap.sdk.SearchResultEntry; |
#!/usr/bin/env ruby | |
# Given an absolute path to a ruby file and an optional RVM directory, locates | |
# both an `.rvmrc` and a `Gemfile` and runs the script with both. | |
script = ARGV.shift | |
$rvm_path = ARGV.shift.to_s | |
rvm_script = "#{$rvm_path}/scripts/rvm" | |
$rvm_path = nil unless File.exists?(rvm_script) | |
bundler = nil |
# Implementation of Rails.cache backed by our database. We don't have high | |
# performance or space requirements, so using existing infrastructure for our | |
# caching needs is desirable. | |
class DatabaseCacheStore < ActiveSupport::Cache::Store | |
class CacheEntry < ActiveRecord::Base | |
end | |
def self.migrate_up(m) | |
m.create_table :cache_entries do |t| | |
t.string :key, :null => false |
# By default, rspec/rails tags all specs in spec/integration as request specs, | |
# which is not what we want. There does not appear to be a way to disable this | |
# behaviour, so this file is a copy of rspec/rails.rb with this default | |
# behaviour commented out. | |
require 'rspec/core' | |
RSpec::configure do |c| | |
c.backtrace_clean_patterns << /vendor\// | |
c.backtrace_clean_patterns << /lib\/rspec\/rails/ | |
end |
# Old way, creates too many connections, breaks transactional fixtures. | |
# More broken on 3.2 than 3.1, didn't identify exact change though. | |
# | |
# Our suite was passing on 3.1 by accident when we initially tried to upgrade to 3.2, | |
# which broke everything. Since then, have added new specs that exposed the problem in 3.1. | |
# | |
# This is probably not a rails bug, but was surprising. | |
module OtherModel | |
def self.included(klass) | |
klass.instance_eval do |
class A | |
def say_name | |
puts name | |
end | |
private | |
def name; "A"; end | |
end |
#!/bin/bash | |
# Input: | |
# output this 6 | |
# do not output this 5 | |
# output this 7 | |
# | |
# Output (and a non-zero exit code): | |
# output this 6 | |
# output this 7 |
require 'integration_helper' | |
require 'rack' | |
require 'rack/handler/webrick' | |
describe HttpClient do | |
before :all do | |
@server = WEBrick::HTTPServer.new( | |
:Port => 9293, | |
:Logger => Rails.logger, | |
:AccessLog => Rails.logger |
describe '#transform_hash' do | |
it 'transforms a single entry hash' do | |
transform_hash(a: [1, 0]).should == [[1], [0]] | |
end | |
it 'transforms a double entry hash' do | |
transform_hash(a: [1, 0], b: [0, 1]).should == [[1, 0], [0, 1]] | |
end | |
it 'transforms a multiple entry hash' do |