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
<script> | |
/* | |
* IE10 viewport handler for use on mobile devices and snapped desktop | |
*/ | |
(function(document,navigator) { | |
'use strict'; | |
var msViewportStyleShim = document.createElement('style'); | |
msViewportStyleShim.appendChild( | |
document.createTextNode( | |
'@-ms-viewport{width:' + ( |
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
if (!('ontouchstart' in window)) { | |
// create synthetic touch events | |
var idCounter = 0, | |
emptyArray = []; | |
$(document).on('mousedown',function (e) { | |
console.log('faking touchstart'); | |
var evt = new CustomEvent('touchstart',{ | |
bubbles : true, | |
cancelable : true | |
}); |
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
util = require "util" | |
xmpp = require "node-xmpp" | |
oscar = require 'oscar' | |
express = require "express" | |
### | |
The XMPP bot. | |
### |
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
var express = require('express'), | |
request = require('request'), | |
BufferList = require('bufferlist').BufferList, | |
sys = require('sys'); | |
var app = express.createServer( | |
express.logger(), | |
express.bodyDecoder() | |
); |
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
# Load balancer configuration | |
upstream exampleApp { | |
# Directs to the process with least number of connections. | |
least_conn; | |
# One failed response will take a server out of circulation for 20 seconds. | |
server 127.0.0.1:10080 fail_timeout=20s; | |
#server 127.0.0.1:10081 fail_timeout=20s; | |
#server 127.0.0.1:10082 fail_timeout=20s; | |
#server 127.0.0.1:10083 fail_timeout=20s; |
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
/** | |
* shims in console support and ignores calls if console | |
* object is not present in window | |
* @param {String} kind the kind of logging statement to make | |
* @param {Any} argX (optional) the remainder of the logging arguments | |
* @return {Object} returns App | |
*/ | |
function logger (kind /*[,arg1, arg2, ..., argN]*/) { | |
try { | |
if (typeof kind === 'string' && window.console && typeof window.console[kind] === 'function' && typeof Array.prototype.slice === 'function') { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title><!-- whatever -->A Title</title> | |
<meta charset="utf-8"> | |
<!-- [START] script define start --> | |
<meta name="jsinject-modernizer" content="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js"> | |
<meta name="jsinject-jquery" content="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"> | |
<!-- [END] script define --> |
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 | |
# Dropbox setup on a headless Ubuntu Server | |
# Script written by Jesse B. Hannah (http://jbhannah.net) <jesse@jbhannah.net> | |
# Based on http://wiki.dropbox.com/TipsAndTricks/UbuntuServerInstall | |
### | |
# 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 |
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
'use strict'; | |
const path = require('path'); | |
const del = require('del'); | |
const gulp = require('gulp'); | |
const watch = require('gulp-watch'); | |
const FILE_SRC_GLOB = ['src/**/*']; | |
const FILE_SRC_GLOB_NO_JS = [FILE_SRC_GLOB[0], `!${FILE_SRC_GLOB[0]}.js`]; | |
const FILE_DEST_GLOB = 'app'; |
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
'use strict'; | |
function Shit() { | |
this.fo = 'shizzle'; | |
} | |
Shit.prototype.fuck = function() { | |
console.log('Fuck', this, 'shit!'); | |
}; |
OlderNewer