Skip to content

Instantly share code, notes, and snippets.

View fearphage's full-sized avatar
⌨️
Cache rules everything around me.

Phred Lane fearphage

⌨️
Cache rules everything around me.
View GitHub Profile
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) {
(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 =
// 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',
// 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;
#!/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') {
...
// 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;
}
#!/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`
@fearphage
fearphage / 1.js
Last active December 14, 2015 19:28 — forked from getify/1.js
(function(window) {
var
requestAnimationFrame = window.requestAnimationFrame
|| window.msRequestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.oRequestAnimationFrame
,cancelAnimationFrame = window.cancelAnimationFrame
|| window.msCancelAnimationFrame
|| window.msCancelRequestAnimationFrame
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>
// ==UserScript==
// @include https://*.campfirenow.com/*
// ==/UserScript==
(function() {
opera.postError('in here now');
if (!document.hasFocus) {
document.hasFocus = function() {
return !document.hidden;
};