Rich Freedman rfreedman

View DebouncedOnClickListener.java
1 2 3 4 5 6 7 8 9 10
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
1 2 3 4 5 6 7 8
class Mammal
constructor: (@species, @defining_char) ->
print: ->
"Hello I'm a " + @species + ". " +
"I have " + @defining_char + "."
 
cat = new Mammal('cat', 'claws')
alert(cat.print())
View spock-controller-integration-spec.groovy
1 2 3 4 5 6 7 8 9 10
/* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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
1 2 3 4 5 6 7 8
class CompoundInstanceControllerIntegrationSpec extends ControllerSpec {
 
static transactional = true
 
def "saving a new compound instance and compound"() {
 
setup:
controller.metaClass.message = {args -> "mockMessage"}
View sample
1 2 3 4 5
public class SampleGist {
public static void main(String[] args) {
System.out.println("this is a gist");
}
}
Something went wrong with that request. Please try again.