This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BLS.unitTests.loadJS = function(strJS, cb) { | |
| var objHead = document.getElementsByTagName('head')[0] | |
| , oEmbed = document.createElement('script') | |
| ; | |
| oEmbed.type = 'text/javascript'; | |
| oEmbed.src = strJS; | |
| oEmbed.async = false; // force to load in order | |
| // listener for when file is done loading |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bls.utils().require( ['/path/to/handlebars.js', '/path/to/template.html'], function( hb, template1) { | |
| // use handlebars via hb var | |
| hb.compile(someTemplateVar, data); | |
| // use template via template1 var | |
| document.getElementById(templateHandle).innerHTML = template1; | |
| } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| guard 'livereload' do | |
| # watch any of these files in this directory and under | |
| watch(%r{^.+\.(css|js|html)}) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/javascript");</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function openHandler(widgetTypeId, userWidgetId, displayOrder, savePrefUrl) { | |
| // some stuff | |
| Utils.addEvent(btnSave, 'click', function () { | |
| btnSaveClick(widgetTypeId, userWidgetId, displayOrder, savePrefUrl); | |
| }); | |
| } | |
| function btnSaveClick(typeId, widgetId, order, url) { | |
| // definition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| // Add ECMA262-5 method binding if not supported natively | |
| // | |
| if (!('bind' in Function.prototype)) { | |
| Function.prototype.bind= function(owner) { | |
| var that= this; | |
| if (arguments.length<=1) { | |
| return function() { | |
| return that.apply(owner, arguments); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var hey = {}; | |
| (function() { | |
| function woot() { | |
| return 'hi'; | |
| } | |
| function who() { | |
| return 'me'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| EMAIL='YOUR_EMAIL' # edit this | |
| PASS='YOUR_PASSWORD' # edit this | |
| COOKIES='cookies.txt' | |
| USER_AGENT='Firefox/3.5' | |
| curl -X POST 'https://github.com/login' --verbose --user-agent $USER_AGENT --data-urlencode "name=${EMAIL}" --data-urlencode "pass=${PASS}" --cookie $COOKIES --cookie-jar $COOKIES | |
| curl -X GET 'https://github.com/dashboard/pulls' --verbose --user-agent $USER_AGENT --cookie $COOKIES --cookie-jar $COOKIES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // go to https://github.com/dashboard/pulls | |
| $('.listing .js-navigation-open').each( | |
| function(key, value) { | |
| console.log('https://github.com' + $(value).attr('href')); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| formatCurrency: function(value, noCents) { | |
| if (!isPrice.test(value)) { | |
| return value; | |
| } | |
| noCents = noCents || false; | |
| var precision = 2 | |
| , price = parseFloat( Math.abs(value) ).toFixed(precision) | |
| , priceArray = String(price).split('.') |