Skip to content

Instantly share code, notes, and snippets.

Jonathan Abourbih jonbca

Block or report user

Report or block jonbca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jonbca
jonbca / serverless.yml
Created Nov 18, 2018
Failing deployment
View serverless.yml
service: catFoodTracker
custom:
tableName: CatFoodTable
provider:
name: aws
runtime: nodejs8.10
memory: 128
profile: default
View 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:

View 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
Is this the only way to turn two arrays into a map in CoffeeScript?
View array-to-map.coffee
arrayToMap = (attributes, values) ->
result = {}
for i in [0...attributes.length]
result[attributes[i]] = values[i]
result
@jonbca
jonbca / app.coffee
Last active Dec 17, 2015
Testing Ember with ember-testing and Jasmine
View app.coffee
Ember.testing = true
App = Ember.Application.create()
App.setupForTesting()
App.injectTestHelpers()
App.Store = DS.Store.extend
revision: 12
adapter: 'DS.FixtureAdapter'
View example.html
<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 Jul 30, 2012
Using requirejs with Backbone
View main.js
require.config({
shim: {
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
underscore: {
exports: '_'
}
},
View coffeetest.coffee
define ['module', 'jquery'],
(module, $) ->
configValue:
module.config().text
@jonbca
jonbca / ratings.xml
Created Sep 8, 2011
YQL Food Ratings Query
View ratings.xml
<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 Mar 21, 2011
Anonymous Inner Class example
View gist:879392
import javax.swing.*;
import java.security.*
class InnerClassStupidity {
void someAction() {
AccessController.doPrivileged( new PrivilegedAction() {
public Object run() {
SwingUtilities.invokeLater( new Runnable() {
public void run() {
You can’t perform that action at this time.