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
/* | |
http://www.jquery4u.com/snippets/url-parameters-jquery/ | |
*/ | |
$.urlParam = function(name){ | |
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); | |
return results[1] || 0; | |
} |
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
//capture ipad device change (IOS7) tested. | |
function doOnOrientationChange() | |
{ | |
// alert(window.orientation); | |
switch(window.orientation) | |
{ | |
case 0: | |
case 90: | |
// alert('portrait'); | |
$('html').removeClass('landscape').addClass('portrait'); |
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 cryptojs = require('crypto') | |
, salt = "<client app salt token>" | |
, keyIterations = 1000 //number of interations to generate your key | |
, keyLength | |
, key | |
, password | |
, cipher | |
, msg = "<what you want to encrypt>" | |
, encryptedMsg; |
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
/** | |
* CSRF Token Security. | |
*/ | |
(function() { | |
angular.module("app").config(['$httpProvider', function ($httpProvider) { | |
//check for token in meta tag | |
var csrf_token = $('meta[name=csrf-token]').attr('content'); |
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
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
RewriteEngine On | |
# Redirect root requests | |
RewriteCond %{REQUEST_URI} ^/$ | |
RewriteRule !^/ /back-end/public%{REQUEST_URI} [L] |
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 _functionName(url) { | |
return Q.fcall(function () { | |
var deferred = Q.defer(); | |
var options = { | |
url: url, | |
headers: { | |
'User-Agent': 'my-app' | |
}, |
NewerOlder