Skip to content

Instantly share code, notes, and snippets.

View brandonaaskov's full-sized avatar

Brandon Aaskov brandonaaskov

  • Mainframe Labs LLC
  • Maine, USA
View GitHub Profile
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 21, 2024 01:20
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@stuartf7
stuartf7 / qunit.teamcity.js
Created February 6, 2012 22:54
qUnit output for Teamcity
QUnit.moduleStart = function (name, testEnvironment) {
console.log("##teamcity[testSuiteStarted name='" + name + "']");
};
QUnit.moduleDone = function (name, failures, total) {
console.log("##teamcity[testSuiteFinished name='" + name + "']");
};
QUnit.testStart = function (name, testEnvironment) {
console.log("##teamcity[testStarted name='" + name + "']");
@eirikbacker
eirikbacker / addEventListener-polyfill.js
Created June 3, 2012 19:30
addEventListener polyfill for IE6+
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}
@aymanfarhat
aymanfarhat / urlobject.js
Last active July 27, 2017 00:04
JS utility function that: - Breaks down url to an object with accessible properties: protocol, parameters object, host, hash, etc... - Converts url parameters to key/value pairs - Convert parameter numeric values to their base types instead of strings - Store multiple values of a parameter in an array - Unescape parameter values
function urlObject(options) {
"use strict";
/*global window, document*/
var url_search_arr,
option_key,
i,
urlObj,
get_param,
key,
@matthiasg
matthiasg / docs style (bootstrap)
Created August 5, 2013 06:26
the callouts from the bootstrap documentation
/* Side notes for calling out things
-------------------------------------------------- */
/* Base styles (regardless of theme) */
.bs-callout {
margin: 20px 0;
padding: 15px 30px 15px 15px;
border-left: 5px solid #eee;
@8bitDesigner
8bitDesigner / _usage.js
Last active December 21, 2015 05:08
Properly inheriting objects in Javasacript
function Child() {
Parent.call(this);
}
extends(Child, Parent);
@8bitDesigner
8bitDesigner / .powrc
Last active December 28, 2015 22:09 — forked from nbibler/gist:5307941
Everything you need to use RVM _sanely_.
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
web: node index.js
@8bitDesigner
8bitDesigner / thing.js
Last active August 29, 2015 13:56
Copy the title and link of every selected TP card
copy($('.tau-selected.tau-card-v2').map(function(i, el) {
return $(el).data('card-data')
}).toArray().sort(function(a, b) {
return (a.type === b.type) ? 0 : a.type > b.type
}).map(function(obj) {
return window.location.origin + '/entity/' + obj.id + ' -- ' + '[' + obj.type + '] ' + obj.name
}))