Skip to content

Instantly share code, notes, and snippets.

View jergason's full-sized avatar
🦢
theft puts a parade in my walk

Jamison Dance jergason

🦢
theft puts a parade in my walk
View GitHub Profile
@jergason
jergason / view.coffee
Created November 9, 2012 15:48
Better Child Views in Backbone
# Base view class that all views extend
# NOTE: This is from real production code, so it has some messiness for
# dealing with real production issues.
View = Backbone.View.extend
initialize: (@model) ->
@render
super
@jergason
jergason / email.txt
Created April 23, 2017 22:37
React Rally CFP: Delaying Talk Acceptance/Rejection until April 30th
TLDR: We need more time to review your proposals. You'll get a yes or no by Sunday, April 30th.
Dear wonderful CFP submitters:
Thank you so much for your proposals. There are SO MANY, WOW. Unfortunately, we have not been able to give them all the attention they deserve. We said we'd notify submitters by April 23rd, but to make sure we have time to carefully review them all we are changing that date to Sunday, April 30th. Estimates are hard.
We are sorry we are pushing back the notification date. We would rather change a deadline than make rushed decisions, but ideally we would have been done already. We are reviewing and changing our CFP review process to make sure this won't happen again. Sorry for the delay, thank you for your proposals, and we will be in touch.
- Jamison and Matt
update : Action -> Model -> (Model, Effects Action)
update action model =
case action of
Actions.PlaySound soundName ->
( model, sendToJs soundName )
Actions.NoOp ->
( model, Effects.none )
Actions.SetAngel showing ->
let
updatedModel = {model | showingAngels = showing }
Ticket = Backbone.Model.extend({
urlRoot: 'api/Ticket/'
});
TicketView = Backbone.View.extend({
initialize: function(model) {
this.model = model;
this.listenTo(this.model, 'change', this.render.bind(this));
this.render()
@jergason
jergason / index.html
Last active December 11, 2015 23:39
Deleting a record removes all records? This is using the latest Ember and Ember Data built from master on January 30th, 2013. What am I doing dumb? Start the webserver and navigate to http://localhost:3000/#/tab, and click the delete button on one of the tab items, and behold the weirdness.
<!DOCTYPE html>
<head>
<title>Ordr: Rstaurant Mnu Systm</title>
<script type="text/x-handlebars" data-template-name="tab">
<ul>
{{#each tabItem in tabItems}}
{{ partial "tabItem" }}
{{else}}
<li><h3>Click a food to add it</h3></li>
{{/each}}
// @flow
require('./es6')()
@jergason
jergason / promises_vs_callbacks.js
Created November 20, 2012 15:42
Promises vs nested callbacks?
// Assume the error handling logic is pretty different at each async step,
// and I have multiple different error conditions that require different
// actions to handle them.
// How can I do this with promises without passing some kind of additional
// data to the error handler so it can know what logic to use?
function someFattyAsyncThing(data, cb) {
someAsyncOp(data, function (err, res) {
if (err) {
return cb(err);
}
@jergason
jergason / jasmine.js
Created August 8, 2012 04:37 — forked from fivetanley/jasmine.js
jasmine again
define( [ 'views/SearchView' ], function( SearchView ){
describe('SearchView', function() {
var searchView, spy
beforeEach(function() {
setFixtures( $( "<input type='search' id='search'/>" ) )
searchView = new SearchView()
searchView.render()
spy = jasmine.createSpyObj( 'event', [ 'handler' ] )
})
destroy: function() {
this.$el.remove()
this.off()
// destroy any children
for (var selector in this.autoChildren)
this.destroyChild(selector)
this.autoChildren = null
}
⨀_⨀
⨂_⨂
(/◔ ◡ ◔)/
°ﺑ°
(¬_¬)
(´・ω・`)
(ʘ_ʘ)
(ʘ‿ʘ)
(๏̯͡๏ )
(◕_◕)