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 getChars = function (size) { | |
var str = '', | |
i = 0, | |
chars = '0123456789abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ'; | |
while (i < size) { | |
str += chars.substr(Math.floor(Math.random() * 62), 1); | |
i++; | |
} | |
return str; | |
} |
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 encrypt($mprhase) { | |
$MASTERKEY = "some key here"; | |
$td = mcrypt_module_open('tripledes', '', 'ecb', ''); | |
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); | |
mcrypt_generic_init($td, $MASTERKEY, $iv); | |
$crypted_value = mcrypt_generic($td, $mprhase); | |
mcrypt_generic_deinit($td); | |
mcrypt_module_close($td); | |
return base64_encode($crypted_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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>TITLE</title> | |
<!-- [if lt IE 9]> | |
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | |
<![end if]--> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
</head> |
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
// in a new array | |
var reverseArray = function (old_array) { | |
var new_array = []; | |
for (i=0; i<=old_array.length-1; i++) { | |
new_array[old_array.length-1 - i] = old_array[i]; | |
} | |
return new_array; | |
} | |
// in the same array |
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 traverse(obj) { | |
for (var prop in obj) { | |
// do something with obj[prop] | |
if (obj[prop] !== null && typeof(obj[prop])=="object") { | |
//going on step down in the object tree!! | |
traverse(obj[prop]); | |
} | |
} | |
} |
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
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700" type="text/css" /> | |
<style type="text/css"> | |
.srood_container { | |
font-family:'Lato'; | |
max-width:960px; | |
margin:0 auto; | |
padding:2em 0 2em 0; | |
} | |
.srood_container .heading-primary { | |
font-size:1.9em; |
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
{ | |
"cat0":[ | |
{ | |
"id":3291, | |
"title":"شاورمة دجاج بالجبن", | |
"parentRstrnt":"مطعم سكوزي", | |
"img":"http://images.grabhouse.com/urbancocktail/wp-content/uploads/2015/05/1-Source-oaza.eb2a.me_.jpg", | |
"price":"3500" | |
}, | |
{ |
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 is_chrome = ((navigator.userAgent.toLowerCase().indexOf('chrome') > -1) &&(navigator.vendor.toLowerCase().indexOf("google") > -1)); |
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
$.file2URI = function (obj) { | |
if (obj.el.files && obj.el.files[0]) { | |
var reader = new FileReader(); | |
reader.onload = function (e) { | |
obj.success(e.target.result); | |
} | |
reader.readAsDataURL(obj.el.files[0]); | |
} | |
else { | |
obj.error(); |
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
/** | |
* | |
* input file => data URI | |
* image => cropped image | |
* | |
**/ | |
(function($) { | |
/** |
OlderNewer