Skip to content

Instantly share code, notes, and snippets.

joepie91 / some-module.js
Last active August 29, 2015 14:15
Configurable exports in Node.js
View some-module.js
module.exports = function(configuration) {
var configuredInstance = createInstance(configuration);
return function(argOne, argTwo) {
return configuredInstance.doAnotherThing(argTwo);
nzakas /
Last active August 29, 2015 14:18
Staff Software Engineer, Front-end Frameworks, Box

Staff Software Engineer, Front-end Frameworks (Los Altos, CA)

Box's Front-end Frameworks team is looking for an experienced engineer to join us at our Los Altos, CA headquarters on our mission to make building web applications on top of the Box infrastructure easy, fast, and fun.

About the Team

Front-end Frameworks ensures that Box web applications are built on top of the best tools and frameworks available. We actively evaluate third-party libraries and frameworks, as well as building our own, to make sure our feature teams can be as effective and iterative as possible. In the past two years, we've led the establishment of front-end best practices, created a lightweight client-side framework that has improved developer experience by enforcing conventions and loose coupling, and started putting together a Node.js framework to power the next generation of Box web applications.

About the Job

jmcph4 / gridster.html
Created October 22, 2012 03:41
A very quick and very messy example of the jQuery plugin gridster.js.
View gridster.html
<script src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
$(function(){ //DOM Ready
$(".gridster ul").gridster({
widget_margins: [10, 10],
widget_base_dimensions: [140, 140]
qawemlilo / paginate.js
Last active December 7, 2015 20:42
HBS helper for pagination
View paginate.js
hbs.registerHelper('paginate', function(pagination, context) {
var lists = '';
if (pagination.isFirstPage) {
lists += '<li class="disabled"><a href="#">&laquo; Prev</a></li>';
else {
lists += '<li><a href="' + pagination.base + '?';
lists += 'p=' + pagination.prev + '">' + '&laquo; Prev</a></li>';
View gist:6085968
[httplog] Connecting:
[httplog] Sending: POST
[httplog] Data: <?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1="urn:usaepay" xmlns:xsd="" xmlns:xsi="" xmlns:SOAP-ENC="" SOAP-ENV:encodingStyle=""><SOAP-ENV:Body><ns1:runAuthOnly><Token xsi:type="ns1:ueSecurityToken"><PinHash xsi:type="ns1:ueHash"><HashValue xsi:type="xsd:string">7bad37464279bd9016392f12ed2cf8befa8bc232</HashValue><Seed xsi:type="xsd:string">FMTGVOkHvfkugXNC7rZwkLS1PJyOjvBolQiFBs+Evzg=</Seed><Type xsi:type="xsd:string">sha1</Type></PinHash><SourceKey xsi:type="xsd:string">0r19zQBdp5nS8i3t4hFxz0di13yf56q1</SourceKey></Token><Params xsi:type="ns1:TransactionRequestObject"><CreditCardData xsi:type="ns1:CreditCardData"><CardNumber xsi:type="xsd:stri
eshacker / wrong_vs_right_oo_in_js.js
Last active March 2, 2016 07:24
Wrong versus right way to do OO in JS
View wrong_vs_right_oo_in_js.js
/* Reading
* I have a differing opinion. Please help in sorting it out.
// Original code : or I think wrong way to to Object Oriented code.
var Flock = function(n) {
this.seagulls = n;
View hexes.pde
import gifAnimation.*;
GifMaker gifExport;
int loopFrames = 60;
PVector maskOrigin;
Float maskWidth = 250.0;
float orbitWidth = 100.0;
void setup() {
gifExport = new GifMaker(this, "export.gif", 30);
rahuljiresal / openshift-node-force-domain.js
Last active July 22, 2016 08:53
This is a middleware for Connect and Express that redirects any requests to a default domain. Based on, modified to work on Openshift platform.
View openshift-node-force-domain.js
Openshift uses haproxy ( as a front proxy to route request to instances of the app.
This proxy does the job of unwrapping https and sets the 'x-forwarded-proto' header.
Because of this, the Node.JS app never sees the actual protocol of the request, unless it checks the presence of this header.
I modified the code written by goloroden ( to check this header instead of ports.
This gist does exactly what his code does, except checks for actual protocol instead of relying on the port for the protocol.
var rewrite = function (route, options) {
options = _.defaults({
matt40k / Enable_CDC_On_All_Tables.sql
Created September 25, 2015 10:15
Enable CDC on all tables - Author: Rasmus Reinholdt Nielsen
View Enable_CDC_On_All_Tables.sql
USE [master]
lsloan / Open Selected Finder Folder in iTerm
Last active September 13, 2017 06:10 — forked from al3xandru/gist:1156476
Use the selected folder in Finder to open a shell in iTerm and go to its directory.
View Open Selected Finder Folder in iTerm
Gist title: "Open Selected Finder Folder in iTerm"
Summary: Use the selected folder in Finder to open a shell in iTerm and go to its directory.
See also: