This file contains hidden or 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 QueryString =(function(w){ | |
return { | |
GetVariable: function (variable) { | |
var query = '', | |
vars = [], | |
i = 0, | |
pair = ''; | |
if (!window.location || !window.location.search) { | |
//No query string to search. |
This file contains hidden or 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
//Should fix any console log issues. | |
if (!window.console) { | |
console = { | |
log: function () { }, | |
time : function () { }, | |
timeEnd : function () { } | |
} | |
}; |
This file contains hidden or 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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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 RandomNumbers =(function(w){ | |
return { | |
//l = low | |
//h = high | |
GetInt: function (l, h) { | |
return l + w.Math.floor(Math.random() * (h - l)); | |
}, | |
GetFloat: function (l, h) { | |
return l + w.Math.random() * (h - l); | |
} |
This file contains hidden or 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 canTouch = 'ontouchstart' in window; | |
var startEvent = canTouch ? 'touchstart' : 'mousedown'; | |
var moveEvent = canTouch ? 'touchmove' : 'mousemove'; | |
var endEvent = canTouch ? 'touchend' : 'mouseup'; |
This file contains hidden or 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 ( window.addEventListener ) { | |
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; | |
window.addEventListener("keydown", function(e){ | |
kkeys.push( e.keyCode ); | |
if ( kkeys.toString().indexOf( konami ) >= 0 ){ | |
//Logic | |
} | |
}, true); | |
} |
This file contains hidden or 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
/// <summary> | |
/// Generic caching call | |
/// </summary> | |
/// <typeparam name="TEntity">Class to map query to</typeparam> | |
/// <param name="query">Query to be executed</param> | |
/// <param name="CacheKey">Unique key used for reference on server</param> | |
/// <param name="CacheDurationSeconds">Duration for data to remain cached</param> | |
/// <returns> List of queried object</returns> | |
public IList<TEntity> GetCached<TEntity>(IQueryable<TEntity> query, string CacheKey, int CacheDurationSeconds) { | |
IList<TEntity> list = System.Web.HttpRuntime.Cache[CacheKey] as IList<TEntity>; |
This file contains hidden or 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 " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=$VIMRUNTIME/../vimfiles/bundle/Vundle.vim/ | |
let path='$VIMRUNTIME/../vimfiles/bundle' | |
call vundle#begin(path) | |
"call vundle#begin() | |
" let Vundle manage Vundle, required |
This file contains hidden or 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
" Vim color file | |
" Maintainer: Marco Peereboom <slash@peereboom.us> | |
" Last Change: August 19, 2004 | |
" Licence: Public Domain | |
" Try to emulate standard colors so that gvim == vim | |
set background=dark | |
hi clear | |
if exists("syntax_on") | |
syntax reset | |
endif |
OlderNewer