This file contains 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(['module'], function(module) { | |
var fullPath = function(name) { | |
var config = module.config(); | |
return (config.path || '') + name; | |
}; | |
return { | |
load: function (name, req, load, config) { | |
req(['wrapper', fullPath(name)], function(Wrapper, value) { | |
if (config.isBuild) { |
This file contains 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(slice) { | |
var proxy = function(source, eventName) { | |
var _self = this; | |
source.on(eventName, function(evt) { | |
_self.trigger.apply(_self, slice.call(arguments).splice(0, 1, eventName)); | |
}); | |
}; | |
Backbone.View.prototype.proxyEvent = | |
Backbone.Model.prototype.proxyEvent = |
This file contains 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
// node.js proxy server example for adding CORS headers to any existing http services. | |
// yes, i know this is super basic, that's why it's here. use this to help understand how http-proxy works with express if you need future routing capabilities | |
var httpProxy = require('http-proxy'), | |
express = require('express'); | |
var proxy = new httpProxy.RoutingProxy(); | |
var proxyOptions = { | |
host: '192.168.3.11', |
This file contains 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
// Require libraries | |
var os = require("os"); | |
var fs = require("fs"); | |
var readline = require("readline"); | |
var cluster = require("cluster"); | |
var express = require("express"); | |
var site = express(); | |
// Var up, bro | |
var i, read; |
This file contains 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
#!/usr/bin/env node | |
var fs = require('fs'); | |
var help = "Usage : trash [-lhx] files...\n\t-l : list trashcan\n\t-x : cancel (files: timestamp)\n\t-h : help"; | |
var trash = process.env['HOME'] + "/.trash/"; | |
(function(argv, log, error) { | |
argv = require('optimist').parse(argv); | |
if (typeof argv.l === 'string') { |
This file contains 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
... | |
// test for font-face version to load via Data URI'd CSS | |
// Basically, load WOFF unless it's android's default browser, which needs TTF, or ie8-, which needs eot | |
var fonts = ns.files.css.fontsWOFF, | |
ua = win.navigator.userAgent; | |
// android webkit browser, non-chrome | |
if( ua.indexOf( "Android" ) > -1 && ua.indexOf( "like Gecko" ) > -1 && ua.indexOf( "Chrome" ) === -1 ){ | |
fonts = ns.files.css.fontsTTF; | |
} |
This file contains 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/sh | |
# btsync service | |
# Replace with linux users you want to run BTSync clients for | |
BTSYNC_USERS="mendel" | |
DAEMON=/usr/bin/btsync | |
start() { | |
echo "Starting btsync..." | |
for btsuser in $BTSYNC_USERS; do | |
HOMEDIR=`getent passwd $btsuser | cut -d: -f6` |
This file contains 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(window) { | |
var | |
requestAnimationFrame = window.requestAnimationFrame | |
|| window.msRequestAnimationFrame | |
|| window.mozRequestAnimationFrame | |
|| window.webkitRequestAnimationFrame | |
|| window.oRequestAnimationFrame | |
,cancelAnimationFrame = window.cancelAnimationFrame | |
|| window.msCancelAnimationFrame | |
|| window.msCancelRequestAnimationFrame |
This file contains 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
10:43.05 [w3] -!- Irssi: Looking up irc.w3.org | |
10:43.05 [w3] -!- Irssi: Reconnecting to irc.w3.org [128.30.52.109] port 80 - use /RMRECONNS to abort | |
10:43.05 [w3] -!- Irssi: Connection to irc.w3.org established | |
10:43.05 [w3] -!- <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> | |
10:43.05 [w3] -!- <html><head> | |
10:43.05 [w3] -!- <title>400 Bad Request</title> | |
10:43.05 [w3] -!- </head><body> | |
10:43.05 [w3] -!- <h1>Bad Request</h1> | |
10:43.05 [w3] -!- <p>Your browser sent a request that this server could not understand.<br /> | |
10:43.05 [w3] -!- </p> |
This file contains 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
// ==UserScript== | |
// @include https://*.campfirenow.com/* | |
// ==/UserScript== | |
(function() { | |
opera.postError('in here now'); | |
if (!document.hasFocus) { | |
document.hasFocus = function() { | |
return !document.hidden; | |
}; |