Skip to content

Instantly share code, notes, and snippets.

@happyBanshee
happyBanshee / IIS_Verbs.config
Created August 19, 2017 18:41 — forked from Jalalhejazi/IIS_Verbs.config
CORS: Web.config to enable CORS
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*"/>
<add name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE,OPTIONS"/>
<add name="Access-Control-Allow-Headers" value="Content-Type"/>
</customHeaders>
</httpProtocol>
@happyBanshee
happyBanshee / aspnet-mvc.gitignore
Created August 5, 2017 19:59 — forked from indyfromoz/aspnet-mvc.gitignore
.Gitignore for ASP.NET MVC
###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
@happyBanshee
happyBanshee / jquery.doubletap.js
Created December 29, 2016 13:58 — forked from asgeo1/jquery.doubletap.js
doubletap event for jquery
//based on blog post that I saw here: http://www.sanraul.com/2010/08/01/implementing-doubletap-on-iphones-and-ipads/
(function($){
$.fn.doubletap = function(fn) {
return fn ? this.bind('doubletap', fn) : this.trigger('doubletap');
};
$.attrFn.doubletap = true;
$.event.special.doubletap = {
setup: function(data, namespaces){
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
@happyBanshee
happyBanshee / getPropIfExist.js
Created February 15, 2016 12:49 — forked from Reshetnyak/getPropIfExist.js
Get object property if it exist. Nesting depth doesn't matter
/**
* Get object property if it exist.
* @param {string} propStr - property of object with any level of nesting. 'person.address.home.floor'
* @returns {*} needed property
*/
function getPropIfExist(propStr){
var props = propStr.split('.');
var lastIndex = props.length - 1;
var i = 0;