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 (var key in items.images) { | |
var obj = items.images[key]; | |
for (var prop in obj) { | |
if(obj.hasOwnProperty(prop)){ | |
console.log(prop + " = " + 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
function hexToRgb(hex) { | |
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") | |
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; | |
hex = hex.replace(shorthandRegex, function(m, r, g, b) { | |
return r + r + g + g + b + b; | |
}); | |
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | |
return result ? { | |
r: parseInt(result[1], 16), |
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).bind("beforeunload", function() { | |
return confirm("Do you really want to close?"); | |
}); |
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 preview(input) { | |
var theID = $(input).attr('data-id'); | |
console.log(theID); | |
var imgPreview = $('.preview[data-id='+theID+']'); | |
if (input.files && input.files[0]) { | |
var reader = new FileReader(); | |
reader.onload = function (e) { | |
imgPreview.attr('src', e.target.result); | |
} | |
reader.readAsDataURL(input.files[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
<?php | |
if (isset($_POST)) | |
{ | |
$error_found = FALSE; | |
// Some input field checking | |
if ($error_found == FALSE) | |
{ | |
// Use the wp redirect function |
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 | |
if(qtrans_getLanguage()=='en') { | |
// put your code here if the current language code is 'en' (English) | |
} elseif(qtrans_getLanguage()=='id') { | |
// put your code here if the current language code is 'id' (Indonesian) | |
} | |
?> |
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
/* CSS Hacks from http://www.quora.com/Web-Development/What-are-the-most-interesting-HTML-JS-DOM-CSS-hacks-that-most-web-developers-dont-know-about | |
* { background-color: rgba(255,0,0,.2); } | |
* * { background-color: rgba(0,255,0,.2); } | |
* * * { background-color: rgba(0,0,255,.2); } | |
* * * * { background-color: rgba(255,0,255,.2); } | |
* * * * * { background-color: rgba(0,255,255,.2); } | |
* * * * * * { background-color: rgba(255,255,0,.2); } |
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
/** | |
* Gradient Background from http://aerotwist.com/static/design/better-password-form-fields/demo/index.html | |
*/ | |
background: #f06; | |
background-image: radial-gradient(circle farthest-side at 66% -9%, #FFFFFF 0%, #FAE7D3 6%, #93CDC4 25%, #2B73A4 61%, #003D62 87%, #010A37 100%); | |
min-height: 100%; |
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 opposite(c) { | |
var result=''; | |
var ch=''; | |
var list1='0123456789ABCDEF'; | |
var list2='FEDCBA9876543210'; | |
for (var i=0; i<c.length; i++) { | |
ch=c.charAt(i); | |
for (var n=0; n<list1.length; n++) { | |
if(ch==list1.charAt(n)) result += list2.charAt(n); |