import android.os.SystemClock;
import android.view.View;
import java.util.Map;
import java.util.WeakHashMap;
* A Debounced OnClickListener
* Rejects clicks that are too close together in time.
* This class is safe to use as an OnClickListener for multiple views, and will debounce each one separately.
View gist:1214540
class Mammal
constructor: (@species, @defining_char) ->
print: ->
"Hello I'm a " + @species + ". " +
"I have " + @defining_char + "."
cat = new Mammal('cat', 'claws')
View spock-controller-integration-spec.groovy
/* Copyright 2011 the original author or authors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
View spock-integration-grails-controller.groovy
class CompoundInstanceControllerIntegrationSpec extends ControllerSpec {
static transactional = true
def "saving a new compound instance and compound"() {
controller.metaClass.message = {args -> "mockMessage"}
View sample
public class SampleGist {
public static void main(String[] args) {
System.out.println("this is a gist");