Skip to content

Instantly share code, notes, and snippets.

@jonbca
jonbca / serverless.yml
Created November 18, 2018 15:10
Failing deployment
service: catFoodTracker
custom:
tableName: CatFoodTable
provider:
name: aws
runtime: nodejs8.10
memory: 128
profile: default
@jonbca
jonbca / keybase.md
Created February 18, 2016 22:20
keybase.md

Keybase proof

I hereby claim:

  • I am jonbca on github.
  • I am jonbca (https://keybase.io/jonbca) on keybase.
  • I have a public key ASD-4t-K_vWQoQpRlQ2fMqeW2KCxgtkJF33dpD52uXslcgo

To claim this, I am signing this object:

@jonbca
jonbca / peach.rb
Last active August 29, 2015 14:05 — forked from joejag/peach.rb
class Array
def peach(&block)
threads = []
self.each do |item|
threads << Thread.new do
block.call(item)
end
end
threads.each(&:join)
end
@jonbca
jonbca / array-to-map.coffee
Created May 7, 2013 15:22
Is this the only way to turn two arrays into a map in CoffeeScript?
arrayToMap = (attributes, values) ->
result = {}
for i in [0...attributes.length]
result[attributes[i]] = values[i]
result
@jonbca
jonbca / app.coffee
Last active December 17, 2015 01:19
Testing Ember with ember-testing and Jasmine
Ember.testing = true
App = Ember.Application.create()
App.setupForTesting()
App.injectTestHelpers()
App.Store = DS.Store.extend
revision: 12
adapter: 'DS.FixtureAdapter'
@jonbca
jonbca / example.html
Last active December 16, 2015 21:50 — forked from markprovan/example.js
<table {{bindAttr class="length:show:hide"}}>
<thead><tr><th>foo</th></tr></thead>
<tbody>
{{#each item in controller}}
<tr><td>{{item.name}}</td></tr>
{{/each}}
</tbody>
</table>
<div {{bindAttr class="length:hide:show"}}>
@jonbca
jonbca / main.js
Created July 30, 2012 16:54
Using requirejs with Backbone
require.config({
shim: {
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
underscore: {
exports: '_'
}
},
define ['module', 'jquery'],
(module, $) ->
configValue:
module.config().text
@jonbca
jonbca / ratings.xml
Created September 8, 2011 23:09
YQL Food Ratings Query
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Jonathan Abourbih</author>
<description>Query for UK Food Ratings</description>
</meta>
<bindings>
<select itemPath="" produces="XML">
<inputs>
<key id="eid" paramType="variable" type="xs:string" required="true" batchable="false"/>
</inputs>
@jonbca
jonbca / gist:879392
Created March 21, 2011 12:42
Anonymous Inner Class example
import javax.swing.*;
import java.security.*
class InnerClassStupidity {
void someAction() {
AccessController.doPrivileged( new PrivilegedAction() {
public Object run() {
SwingUtilities.invokeLater( new Runnable() {
public void run() {