Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am finneycanhelp on github.
  • I am finneycanhelp (https://keybase.io/finneycanhelp) on keybase.
  • I have a public key ASAmsimbE-61H5mn5ZjFzHqG6uKcTWCjk1cZEIyXc_--7Ao

To claim this, I am signing this object:

View FetchedResultsControllerTableViewDataSource.swift
import Foundation
import RealmSwift
import SwiftFetchedResultsController
protocol FetchedResultsControllerTableViewDataSource: class {
associatedtype T : Object
var fetchedResultsController: FetchedResultsController<T>? { get set }
@finneycanhelp
finneycanhelp / hardcoded_winasmile_request.js
Created Jun 19, 2011
hard coded request to winasmile json server
View hardcoded_winasmile_request.js
$(function() {
$.getJSON('http://winasmile.finneycanhelp.c9.io', function(data) {
var msg = data.message;
$('.messageContainer').html(msg);
});
@finneycanhelp
finneycanhelp / HappyControllerTests.groovy
Created Mar 6, 2011
calling demand twice on GrailsMock
View HappyControllerTests.groovy
package com.fch
import grails.test.*
class HappyControllerTests extends ControllerUnitTestCase {
GrailsMock staticWorldMock
protected void setUp() {
super.setUp()
@finneycanhelp
finneycanhelp / SomeService.groovy
Created Jan 17, 2011
SomeService with a "get" method that just returns false
View SomeService.groovy
package com
class SomeService {
static transactional = true
boolean get(String something) {
return false
}
}
@finneycanhelp
finneycanhelp / Something.groovy
Created Jan 17, 2011
simple groovy Something calling a grails service "someService"
View Something.groovy
package com
class Something {
def someService
boolean methodWeAreTesting() {
someService.get()
}
@finneycanhelp
finneycanhelp / SomethingTests.groovy
Created Jan 17, 2011
Test Showing Why "as" operator is important
View SomethingTests.groovy
package com
import grails.test.GrailsUnitTestCase;
import com.SomeService
class SomethingTests extends GrailsUnitTestCase {
void testSomething() {
Something thing = new Something()
// thing.someService = [ get : { a -> throw new Throwable() } ] as SomeService // works
View an out method that spits out the class name
class OutShow {
private void out(String msg) {
println("******* " + getClass().simpleName + ": " + msg);
}
public static void main(String[] args) {
new OutShow().out("hi");
}