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($){ | |
"use strict" | |
//Define your library strictly. | |
})(jQuery|Ender) |
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
.boxshadow{ | |
background-color: #fff; | |
filter: progid:DXImageTransform.Microsoft.Shadow(color='#b7b8b3', Direction=120, Strength=3); | |
zoom: 1; | |
} | |
.boxshadow-disable{ | |
filter: progid:DXImageTransform.Microsoft.Shadow(enabled=false); | |
} |
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
AuthType Basic | |
AuthName "Restricted Resource" | |
AuthUserFile PATH_OF_HTPASSES_FILE | |
Require valid-user | |
# Relplace PATH_OF_HTPASSES_FILE with path to file .htpasses |
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 getPageUrl() { | |
$pageURL = 'http'; | |
if ($_SERVER["HTTPS"] == "on"){ | |
$pageURL .= "s"; | |
} | |
$pageURL .= "://"; | |
if ($_SERVER["SERVER_PORT"] != "80") { | |
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; | |
}else | |
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; |
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
#For jpeg files | |
#Need to install jpegtran in ubuntu | |
sudo apt-get install libjpeg-progs | |
Usage tips: | |
#To optimise a single jpeg image: | |
jpegtran -copy none -optimise -outfile image.jpg image.jpg | |
#To optimise all jpegs in the current directory: | |
for img in `ls *.jpg`; do jpegtran -copy none -optimise -outfile $img $img; done |
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
<?php | |
class Utility{ | |
static $random = ""; | |
static function generate_password($length = 12, $special_chars=true) | |
{ | |
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; | |
if($special_chars) $chars .= '!@#$%^&*_-()'; | |
$password = ""; | |
for($i=0;$i<$length;$i++) |
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
<?php | |
function get_private_key_for_public_key($public_key) { | |
// extract private key from database or cache store | |
return 'private_key_user_id_9999'; | |
} | |
// Data submitted | |
$data = $_GET['data']; | |
$data = json_decode(stripslashes($data), 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
window.dome = (function(){ | |
function Dome(els){ | |
} | |
var dome = { | |
get: function(selector){ | |
} | |
}; | |
return dome; | |
}); |
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 counter = (function(){ | |
var i = 0, | |
timer = {}; | |
timer.get = function(){ | |
return i; | |
}; | |
timer.set = function(value){ | |
i = value; | |
}; | |
timer.increment = function(){ |
OlderNewer