Skip to content

Instantly share code, notes, and snippets.

View kbaribeau's full-sized avatar

Kevin Baribeau kbaribeau

  • Test Double
  • Saskatoon, SK, Canada
View GitHub Profile
function fix-file-endings () {
for f in `git ls-files`
do
newline='
'
lastline=$(tail -n 1 $f; echo x); lastline=${lastline%x}
[ "${lastline#"${lastline%?}"}" != "$newline" ] && echo >> $f
done
}
@kbaribeau
kbaribeau / gist:3784044
Created September 25, 2012 19:51 — forked from nhajratw/gist:3783890
accessing functions??
var cycleTimeFunctionThatNeedsABetterName = function(acceptedDate, inProgressDate) {
var cycleTime = Math.round(Ext.Date.getElapsed(acceptedDate,inProgressDate) / 1000 / 60 / 60 / 24);
if (cycleTime === 0) cycleTime = 1;
return cycleTime;
};
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
window.CountCalculator=window.PriceCalculator=window.TaxCalculator=window.ShippingCaclulator = {
calculate: (num) -> (num == undefined ? 0 : num + 1) }
ChainsCalls =
chain: (dependencies, method) ->
_(dependencies).inject((memo, dependency) ->
dependency[method](memo)
, undefined)
Invoice =