This file contains hidden or 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
# dranor.cf a set of rules made due to major annoyance when checking my personal accounts | |
# WARNING: It can contain profane language and offensive opinions | |
# Deals Are Us bullshit | |
header __DEALSAREUS_1 Subject =~ /deals are us/i | |
header __DEALSAREUS_2 From =~ /deals-are-us/i | |
meta DEALS_ARE_US ((__DEALSAREUS_1 + __DEALSAREUS_2) >= 1) | |
describe DEALS_ARE_US Spanish bulk mailer, i just hope their servers burn | |
score DEALS_ARE_US 7.0 |
This file contains hidden or 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 | |
// Simple DNSBL/RBL PHP function - trust me, it's better than checkdnsrr, fsock, socket_create, Net::DNSBL and Net::DNS | |
// Here's a [better] way to quickly check if an IP is in a DNSBL / RBL. It works on Windows and Linux, | |
// assuming nslookup is installed. It also supports timeout in seconds. | |
function ipInDnsBlacklist($ip, $server, $timeout=1) { | |
$response = array(); | |
$host = implode(".", array_reverse(explode('.', $ip))).'.'.$server.'.'; | |
$cmd = sprintf('nslookup -type=A -timeout=%d %s 2>&1', $timeout, escapeshellarg($host)); | |
@exec($cmd, $response); |
This file contains hidden or 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 | |
header('Content-Type: text/csv; charset=utf-8'); | |
header('Content-Disposition: attachment;filename="export.csv"'); | |
header('Cache-Control: max-age=0'); | |
// See: http://es2.php.net/manual/en/wrappers.php.php | |
$fpcsv = fopen('php://output', "a+"); | |
// Put your SQL query here | |
$exportcsv_q = mysql_query($query); | |
if (@mysql_num_rows($exportcsv_q) > 0) { | |
$campos = mysql_num_fields($exportcsv_q); |
This file contains hidden or 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
/** | |
* Spanish Bank Account Number validation | |
*/ | |
function saneaFormato(str, num) { | |
return '' + new Array((num - str.toString().length)+1).join('0') + str; | |
} | |
function mod11(x) { | |
var pesos = [ 1, 2, 4, 8, 5, 10, 9, 7, 3, 6 ], control = 0, i, offset = pesos.length - x.length; | |
for (i = 0; i < x.length; i++) control += x.charAt(i) * pesos[i+offset]; |
This file contains hidden or 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
// Credit goes to Ashley Ford, since the idea of this snippet | |
// was taken from his blog article at http://papermashup.com/experimental-jquery-tooltips/ | |
// this is a "self-sustained" tooltip, and i stripped the AJAX | |
// part since i don't need it for now | |
$(document).ready(function() { | |
// Tooltip, probando | |
$("[rel^='tooltip']").bind('mouseover', function(){ | |
var theMessage = "Tooltip: "+$(this).attr('rel').split(":", 2).slice(1, 2); | |
$('<div class="tooltip">' + theMessage + '</div>').appendTo('body').fadeIn('fast'); |