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
define(['squire'], function (Squire) { | |
"use strict"; | |
describe("DashboardIndexController", function () { | |
var context = {}; | |
var ready = false; | |
beforeEach(function () { | |
runs(function () { | |
context.injector = new Squire(); |
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
// dataTables.js is great! But it requires you to have "good" tables in | |
// the first place. If your table has an uneven number of columns per | |
// row, and you're getting the dreaded "Cannot read property | |
// 'mData' of undefined" this'll fix it. If you're missing a thead or | |
// tbody you'll get that error too - this won't fix that! | |
$(document).ready(function() { | |
// We need to make sure every row in our table has the same number of columns. | |
// Otherwise dataTable doesn't work. | |
$('table').each(function(i, elm) { |
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 etherpad_client = require('etherpad-lite-client'); | |
module.exports = { | |
/** | |
* list() - list all docs | |
*/ | |
list: function(req, res) { | |
etherpad_api = etherpad_client.connect({ | |
apikey: sails.config.connections.etherpad.apikey, | |
host: sails.config.connections.etherpad.host, |
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
# Put this at the end of your .bash_profile. | |
# | |
# Usage: clearsolr corename | |
clearsolr() { | |
curl http://localhost:8983/solr/$1/update -H "Content-type: text/xml" --data-binary '<delete><query>*:*</query></delete>' | |
curl http://localhost:8983/solr/$1/update -H "Content-type: text/xml" --data-binary '<commit />' | |
curl http://localhost:8983/solr/$1/update -H "Content-type: text/xml" --data-binary '<optimize />' | |
curl http://localhost:8983/solr/$1/update -H "Content-type: text/xml" --data-binary '<commit />' | |
} |
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
# Find a *lot* of files with the wrong extension and fix the extension. | |
for myfile in $(find /var/www/releases/sanfranciscocode/*/production/current/htdocs/downloads/current/code-text -name "*..txt" -type f); do | |
filetrim=${myfile%????}; | |
mv $myfile $filetrim"txt"; | |
done; |
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
To celebrate the fourth, here's Bill's Vegan Potato Salad! (Gluten free as well!) Super creamy and delicious, almost makes you think you're eating the dairy-thing. Makes about 8-10 servings, depending on your appetite. | |
Red Potatoes 5 lbs | |
Dill, finely chopped 1/4 Cup | |
Olive oil 1/2 Cup | |
Rice Vinegar 1/2 Cup | |
Sea Salt 1 teaspoon | |
Black Pepper, fresh ground (a dash) | |
Wash and prep the potatoes, leaving the skins on, and cut into 1/2 inch cubes. Throw them into a large pot with salted water, and boils for 30 minutes. | |
While the potatoes are cooking, remove the stalks from your dill and chop a fistful or so, to yield 1/4 cup. | |
After the potatoes are done cooking, drain with a large colander. At this point, you can either put them in the refrigerator to cool, or speed up the process by dipping them into an ice bath. After they've cooled, dab off any extra water with a paper towel. |
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
/* | |
* Patch to make console.log, console.warn, etc work in IE8 & 9 | |
*/ | |
// Default list of functions for console. | |
var logFns = ["log", "info", "warn", "error", "assert", "dir", "clear", "profile", "profileEnd"]; | |
// Define console. | |
if (typeof console == 'undefined') { | |
console = {}; |
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 compareDocumentPosition(thisNode, other) { | |
function recursivelyWalk(nodes, cb) { | |
for (var i = 0, len = nodes.length; i < len; i++) { | |
var node = nodes[i]; | |
var ret = cb(node); | |
if (ret) { | |
return ret; | |
} | |
if (node.childNodes && node.childNodes.length) { | |
var ret = recursivelyWalk(node.childNodes, cb); |