Skip to content

Instantly share code, notes, and snippets.

View akiellor's full-sized avatar

Andrew Kiellor akiellor

View GitHub Profile
ActionView::Template::Error (Missing partial receipts/receipt_table with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml, :slim, :rep, :csvt], :formats=>[:js, :html], :locale=>[:en, :en]} in view paths "/Users/akiellor/Development/expenselynx/app/views", "/Users/akiellor/.rvm/gems/ruby-1.9.2-p0@expenselynx/gems/devise-1.1.7/app/views"):
7: $("#expensed_total").html("<%= number_to_currency current_user.receipts.where(:expensed => true).sum(:total) %>");
8: $("#expensed_total").effect('highlight', {}, 'slow');
9:
10: $("#recent_receipts").html("<h3 class=\"center\">Recent Receipts</h3><br /><%= escape_javascript(render :partial => 'receipts/receipt_table', :locals => {:receipts => @receipt.user.receipts.recent, :expensable => true, :expensed => true}) %>").effect('highlight', {}, 'slow');
11:
12: $("#new_receipt")[0].reset();
app/views/receipts/create.js.erb:10:in `_app_views_receipts_create_js_erb__211119640030275519_2159261260__1916319490942236634'
app/controllers/receipts_contr
@akiellor
akiellor / hash_spec.rb
Created March 20, 2011 01:54
A simple RSpec test.
describe Hash do
context "with no keys" do
subject { Hash.new }
its(:size) { should == 0 }
end
context "including :a_key => 'a value'" do
subject { {:a_key => 'a_value'} }
@akiellor
akiellor / gist:1153213
Created August 18, 2011 03:14
Gradle plugin to run rspec
apply plugin: 'java'
apply plugin: 'groovy'
configurations { rspec }
repositories {
mavenCentral()
}
dependencies {
@akiellor
akiellor / build.gradle
Created August 18, 2011 05:03
Simple java project
apply plugin: 'java'
repositories { mavenCentral() }
dependencies {
testCompile name: 'junit', group: 'junit', version: '4.8.2'
testCompile name: 'hamcrest-all', group: 'org.hamcrest', version: '1.1'
testCompile name: 'mockito-all', group: 'org.mockito', version: '1.8.5'
}
@akiellor
akiellor / build.gradle
Created August 19, 2011 01:50
Gradle which supports rspec :-)
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
import org.rubygems.repository.GemResolver;
buildscript {
repositories {
mavenCentral()
}
@akiellor
akiellor / ArrayListTest.java
Created September 6, 2011 08:59
RSpec Style Runner for JUnit
@RunWith(BehaviourRunner.class)
@ItBehavesLike(ListBehaviours.class)
public class ArrayListTest {
@Subject ArrayList<String> list(){
return new ArrayList<String>();
}
}
@akiellor
akiellor / Tap.scala
Created October 24, 2011 01:40
An implementation of Ruby's Tap in Scala.
import collection.mutable.MutableList
import Tap._
class Tap[A](any: A) {
def tap(f: (A) => Unit): A = {
f(any)
any
}
}
@akiellor
akiellor / coffee.loader.js
Created October 24, 2011 23:06
CoffeeScript Loader for rhino.
load("coffee-script.js");
var eval = (function(scope){
var __context__ = Packages.org.mozilla.javascript.Context.getCurrentContext();
function __eval(scope, source, name){
__context__.evaluateString(
scope,
source,
name,
@akiellor
akiellor / main.js
Created November 14, 2011 02:19
CommonJS implementation of Polyglot for Rhino.
var polyglot = require('polyglot');
polyglot.register('coffee', require('coffee-script').CoffeeScript.compile);
polyglot.require('math').square(2);
@akiellor
akiellor / servlet.js
Created November 14, 2011 04:37
The best servlet I have ever seen :)
exports.woot = new javax.servlet.http.HttpServlet({
doGet: function(req, res){
res.getWriter().print("woot from JS");
}
})