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() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { | |
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; | |
window.cancelAnimationFrame = | |
window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; | |
} | |
if (!window.requestAnimationFrame) |
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 mousewheelevt=(/Firefox/i.test(navigator.userAgent))? "DOMMouseScroll" : "mousewheel"; | |
if (document.attachEvent) | |
document.attachEvent("on"+mousewheelevt, function(e){scroller(e)}); | |
else if (document.addEventListener) | |
document.addEventListener(mousewheelevt, function(e){scroller(e)},false); | |
function scroller(evt) | |
{ | |
//Guess the delta. |
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 setCSS(prop,value,css){ | |
var ar = ["-webkit-","-o-","-moz-","-ms-","-khtml-",""]; | |
if(css === undefined) | |
{ | |
css = {}; | |
} | |
for(var i = 0, max = ar.length; i<max; i+=1) | |
{ | |
css[ar[i]+prop] = value; | |
} |
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 addScript(type,url,cache,cb){ | |
var script = document.createElement(type), | |
head=document.getElementsByTagName('head')[0], | |
done=false, | |
src = url; | |
src += (cache === false)?('?dummy=' + (+new Date())):''; | |
script.onload=script.onreadystatechange = function(){ | |
if ( !done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete') ) { | |
done=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
CREATE TABLE IF NOT EXISTS `ci_sessions` ( | |
session_id varchar(40) DEFAULT '0' NOT NULL, | |
ip_address varchar(45) DEFAULT '0' NOT NULL, | |
user_agent varchar(120) NOT NULL, | |
last_activity int(10) unsigned DEFAULT 0 NOT NULL, | |
user_data text NOT NULL, | |
PRIMARY KEY (session_id), | |
KEY `last_activity_idx` (`last_activity`) | |
); |
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
/* sans-serif */ | |
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; | |
font-family: Helvetica, "Helvetica Neue", Arial, sans-serif; | |
font-family: Verdana, Geneva, Tahoma, sans-serif; | |
font-family: Trebuchet, Tahoma, Arial, sans-serif; | |
font-family: GillSans, Calibri, Trebuchet, sans-serif; | |
font-family: "DejaVu Sans", "Bitstream Vera Sans", "Segoe UI", "Lucida Grande", Verdana, Tahoma, Arial, sans-serif; | |
font-family: Geneva, "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; | |
font-family: Geneva, Verdana, "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", sans-serif; | |
font-family: "HelveticaNeue-Roman", "Helvetica 55 Roman", Helvetica, Arial, sans-serif; |
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 (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |
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== | |
// @name Userscript Name | |
// @namespace http://example.com/ | |
// @description Userscript Description | |
// @match http://example.com/* (or @include * to include all pages) | |
// @version 1.0 | |
// ==/UserScript== | |
// Emulate Greasemonkey's unsafeWindow in Chrome | |
window.unsafeWindow = window.unsafeWindow || (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
//Cross Domain Headers. | |
//A bit hacky on the referer. | |
var getCorsHeaders = function (req, res){ | |
//Can't put wildcards here, | |
//so here we are, cheating all the way. | |
var ref = req.headers.referer || req.headers.origin; | |
ref = ref?ref.slice(0,-1):"*"; | |
res.set('Access-Control-Allow-Origin', ref); | |
res.set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS'); | |
res.set('Access-Control-Allow-Headers', 'Authorization, X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version, origin'); |
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
Backbone.MOBILE = navigator.userAgent.match(/mobile/i); | |
var View = Backbone.View.extend({ | |
events: function () { | |
return Backbone.MOBILE ? { | |
"click .new_message": "newMessageClick", | |
"touchstart #send_new_message": "openMenu", | |
"touchend #send_new_message": "selectMenu" | |
} : { | |
"click .new_message": "newMessageClick", | |
"mousedown #send_new_message": "openMenu", |
OlderNewer