Skip to content

Instantly share code, notes, and snippets.

INFO:werkzeug:10.0.2.2 - - [17/Aug/2013 00:00:46] "GET /static/lib/mustache.js HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('10.0.2.2', 56038)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/lib/python2.7/SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "/usr/local/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
@bspingarn
bspingarn / gist:6123401
Last active December 20, 2015 11:29
SublimeText snippet for var self = this for Javascript.
<snippet>
<content><![CDATA[
var self = this;
]]></content>
<description>var self = this;</description>
<tabTrigger>selfthis</tabTrigger>
<scope>source.js</scope>
</snippet>
@bspingarn
bspingarn / exposeMod
Last active December 18, 2015 22:08
A simple function for returning RequireJS modules and namespacing them onto the window object for further interaction.
function exposeMod(moduleName){
var reqObject = require(moduleName);
if (moduleName.indexOf('/') ) {
moduleNameArray = moduleName.split('/');
window[moduleNameArray[moduleNameArray.length-1]] = reqObject;
}
else {
window[moduleName] = reqObject;
}
@bspingarn
bspingarn / gist:5613826
Created May 20, 2013 17:37
SublimeText snippet for divs with class attribute
<snippet>
<content><![CDATA[
<div class="${1:classname}">
$2
</div><!--/.$1 -->
]]></content>
<description>div class=""</description>
<tabTrigger>divc</tabTrigger>
<scope>text.html</scope>
</snippet>
@bspingarn
bspingarn / gist:5437840
Created April 22, 2013 19:37
Problem: IE rotate animation acting unpredictable Solution: animate something else just for IE
.rotating {
-webkit-animation: rotating 2s linear infinite;
-moz-animation: rotating 2s linear infinite;
-ms-animation: rotating 1s linear infinite;
}
@-webkit-keyframes rotating {
from{
-webkit-transform: rotate(360deg);
-webkit-transform-origin: 50% 50%;
@bspingarn
bspingarn / gist:5256286
Created March 27, 2013 17:25
Newegg does the right thing
Blake: Hi, my name is Blake. How may I help you?
Bill Spingarn: I ordered a hard drive that I didn't end up needing, but it's past 30 days. I was wondering if I could still return it for a store credit.
Bill Spingarn: Invoice #98272107
Blake: Hi Bill, I am happy to assist you with that. May I please have a moment to look into this for you?
Bill Spingarn: It was purchased just last month, 2/18
Bill Spingarn: sure
Blake: Thank you for holding. We are sorry for the unfavorable situation. The item is beyond our warranty for 6 days, and it can no longer be returned to us. However, you can still contact the manufacturer of the item for direct warranty support. Their contact information is 1-800-726-7864.
Bill Spingarn: I don't need warranty support. I haven't even used it. I can't believe there is nothing you guys can do.
Blake: Is it unopened?
Bill Spingarn: It was just a bare hard drive
@bspingarn
bspingarn / gist:5007267
Created February 21, 2013 19:13
Sort of array of object literals based on a key value
myArray.sort(function(a,b){
return a.propertyName - b.propertyName;
});
@bspingarn
bspingarn / jquery.bootstrap.confirm.popover.js
Last active December 11, 2015 21:58
Modified options to accept a continue handler (continueFn) rather than following the selector's href attribute. Also accepts continueText (string) in options.
/*
Copyright (c) 2011 Damien Antipa, http://www.nethead.at/, http://damien.antipa.at
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@bspingarn
bspingarn / gist:4225600
Created December 6, 2012 16:04
SublimeText2 snippet for JS comment box
<snippet>
<content><![CDATA[
/* ----------------------------------------------------
${1:Message text...}
---------------------------------------------------- */
@bspingarn
bspingarn / charts.js
Created November 15, 2012 17:39
Google Charts API - chart loader module
// This is a chart loading module to simply initializing charts that use a custom API to populate the data tables
google.load('visualization', '1', {'packages': ['corechart','geochart']});
google.setOnLoadCallback(function(){
coCharts.init();
});
var coCharts = (function(){
var colors = {