This is an example from the blog post: http://www.ngauthier.com/2011/09/using-exceptions-to-manage-control-flow.html.
Please fork it and show me what you would do!
Gem::Specification.new do |s| | |
s.name = 'bang' | |
s.version = '0.1.0' | |
s.platform = Gem::Platform::RUBY | |
s.author = 'Jeff Kreeftmeijer' | |
s.email = 'jeff@kreeftmeijer.nl' | |
s.summary = 'Bang!' | |
s.description = 'Bangs existing model methods' | |
s.files = ['bang.rb'] |
This is an example from the blog post: http://www.ngauthier.com/2011/09/using-exceptions-to-manage-control-flow.html.
Please fork it and show me what you would do!
"use strict"; | |
// `f` is assumed to sporadically fail with `TemporaryNetworkError` instances. | |
// If one of those happens, we want to retry until it doesn't. | |
// If `f` fails with something else, then we should re-throw: we don't know how to handle that, and it's a | |
// sign something went wrong. Since `f` is a good promise-returning function, it only ever fulfills or rejects; | |
// it has no synchronous behavior (e.g. throwing). | |
function dontGiveUp(f) { | |
return f().then( | |
undefined, // pass through success |
/** | |
* @license Angular Auth | |
* (c) 2012 Witold Szczerba | |
* License: MIT | |
*/ | |
angular.module('angular-auth', []) | |
/** | |
* Holds all the requests which failed due to 401 response, | |
* so they can be re-requested in the future, once login is completed. |
// node.js proxy server example for adding CORS headers to any existing http services. | |
// yes, i know this is super basic, that's why it's here. use this to help understand how http-proxy works with express if you need future routing capabilities | |
var httpProxy = require('http-proxy'), | |
express = require('express'); | |
var proxy = new httpProxy.RoutingProxy(); | |
var proxyOptions = { | |
host: '192.168.3.11', |
#import <UIKit/UIKit.h> | |
@interface SNFadeScrollView : UIScrollView | |
@property (nonatomic) BOOL fadeTop; | |
@property (nonatomic) BOOL fadeBottom; | |
@end |
/** | |
* Inspired by AngularJS' implementation of "click dblclick mousedown..." | |
* | |
* This ties in the Hammer events to attributes like: | |
* | |
* hm-tap="add_something()" | |
* hm-swipe="remove_something()" | |
* | |
* and also has support for Hammer options with: | |
* |
This class makes it easier to generate a leaderboard that complies with the Standard Competition Ranking system. That is, it takes joint/tied positions into account, and adjusts the positions accordingly.
Take the following list of users and points for example:
User | Points
1 35
2 35
function whichTransitionEvent(){ | |
var t; | |
var el = document.createElement('fakeelement'); | |
var transitions = { | |
'transition':'transitionend', | |
'MSTransition':'msTransitionEnd', | |
'MozTransition':'transitionend', | |
'WebkitTransition':'webkitTransitionEnd' | |
} |
App.module("Dashboard", function(Dashboard, App, Backbone, Marionette, $, _){ | |
"use strict"; | |
var Comp = {}; | |
// Grid Table Structure | |
// -------------------- | |
Comp.GridRow = Marionette.ItemView.extend({ | |
tagName: "tr" |