This is now an actual repo:
def revoke(user) | |
proxy_association.owner.tap do |project| | |
# You can't remove the last user with access (someone has to have access to the project!) | |
if project.users.many? | |
if user.pending? && user.projects.one? | |
user.destroy | |
else | |
project.users.delete(user) | |
user.touch | |
end |
class InputOutput | |
def initialize(&action) | |
@action = action | |
end | |
private_class_method :new | |
# return :: (Monad m) => a -> m a | |
def self.unit(x) | |
new { x } | |
end |
module CoderetreatLive::Coderetreats | |
# this Coderetreat gets loaded instead of the AR | |
class Coderetreat | |
include States | |
end | |
describe "The states a coderetreat can be in" do | |
let(:retreat) { Coderetreat.new } | |
example "Going through the day of a coderetreat" do | |
retreat.should be_not_started | |
retreat.start! |
class ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |
J.B. Rainsberger - Integration Tests are a Scam
J.B. Rainsberger - When Is It Safe to Introduce Test Doubles?
Gary Bernhardt - Boundaries
Gary Bernhardt - Functional Core, Imperative Shell
Tom Stuart - Thinking functionally in Ruby
We create an index with:
- two filters:
synonyms_expand
andsynonyms_contract
- two analyzers:
synonyms_expand
andsynonyms_contract
- three text fields:
text_1
uses thesynonyms_expand
analyzer at index and search timetext_2
uses thesynonyms_expand
analyzer at index time, but thestandard
analyzer at search timetext_3
uses thesynonyms_contract
analyzer at index and search time
.
Originally published in June 2008
When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.
To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.
Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.
import com.twitter.util.{Future => TwFuture} | |
import scala.concurrent.{Future => ScFuture, promise => ScPromise} | |
implicit def twFutureToScala[T](twFuture: TwFuture[T]): ScFuture[T] = { | |
val prom = ScPromise[T] | |
twFuture.onSuccess { res: T => | |
prom.success(res) | |
} | |
twFuture.onFailure { t: Throwable => | |
prom.failure(t) | |
} |
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.