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", |
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
set nocompatible " Disable vi-compatibility | |
set t_Co=256 | |
colorscheme xoria256 | |
set guifont=menlo\ for\ powerline:h16 | |
set guioptions-=T " Removes top toolbar | |
set guioptions-=r " Removes right hand scroll bar | |
set go-=L " Removes left hand scroll bar | |
set linespace=15 |
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 | |
HOME="/Users/`whoami`" | |
echo "Synching dotfiles" | |
#Transfert all dotfiles. | |
SYNC_DOTFILES=${HOME}/Dropbox/Applications/MacOSX/dotfiles/.* | |
LOCAL_DOTFILES=${HOME}/ | |
dot="." | |
dotdot=".." | |
for f in $SYNC_DOTFILES | |
do |
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
/* | |
* Enhances 'require' from RequireJS with Promises API while preserving its original semantics. | |
*/ | |
(function() { | |
if (!Promise || !require) { | |
return; | |
} |
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
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
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
/* 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(); |
OlderNewer