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
# nginx port of https://gist.github.com/netscylla/23fda41e0de8cc211ef518b6954fed8c | |
# | |
# instructions: | |
# save the map $http_user_agent $bad_bot {..} section as /etc/nginx/conf/map-bad-bots.conf | |
# save the deny as /etc/nginx/conf/deny-av.conf | |
# note nginx out the box has no domain name resolver. you'll need to install https://github.com/flant/nginx-http-rdns | |
# | |
# inside /etc/nginx/nginx.conf add the following to the nginx {} section. | |
# include conf/map-bad-bots.conf; | |
# inside your server location {} add the following: |
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 | |
declare(strict_types=1); | |
/** | |
* Class CountryToIso639ValueObject | |
* @author jthatch | |
*/ | |
class CountryToIso639ValueObject | |
{ |
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
#!/usr/bin/env node | |
/* | |
* dnsresolve.js | |
* Will resolve ip ranges to determine if they're google proxies. | |
* | |
* TIPS for increasing speed: | |
* Run on multi-core system | |
* ulimit -n 40000 | |
* | |
* Examples: |
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
#!/usr/bin/env node | |
/* | |
* stripmirc.js | |
* strip mirc color codes from logs | |
* | |
* Examples: | |
* | |
* ./stripmirc.js irc-log.txt > irc-log-new.txt | |
* | |
* (c) jthatch http://github.com/jthatch |
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 | |
/** | |
* | |
* getPics - Takes two directories of portrait and landscape pictures and merges them to create an ordered 2 column thumbnail gallery. | |
* | |
* Instead of reading from an API, it reads pics from the filesystem, caching the results in redis for self::$cache minutes | |
* There currently two pic sizes, "portrait" and "landscape", possibly more added in the future.. | |
* | |
* It will take into account the totals of each size, and spread the smaller sizes evenly across the resulting list in sets of 2. | |
* |
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 | |
/** | |
* Created by PhpStorm. | |
* User: jamest | |
* Date: 02/11/15 | |
* Time: 10:14 | |
*/ | |
class Convert { | |
private $commandLine, $path; |