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
//////////////////////////////////////// | |
// output for text.en.txt | |
Array | |
( | |
[count] => 100 | |
[de] => Array | |
( | |
[found] => 12 | |
[percent] => 12 |
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
tobias:~$ cat .config/fish/config.fish | |
function fish_prompt | |
set_color normal | |
echo -n (whoami) | |
set_color normal | |
echo -n ':' | |
set_color purple | |
echo -n (prompt_pwd) | |
set_color normal |
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 | |
$mongo = assumeMongoConnectHere(); | |
$loop = new React\EventLoop\StreamSelectLoop(); | |
$stack = new React\Espresso\Stack(function ($req, $res) { | |
$query = $req->getQuery(); |
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
#!/usr/local/bin/node | |
var fs = require('fs'), | |
useragent = require('/www/utils/node_modules/useragent'), | |
zoneinfo = require('/www/utils/node_modules/zoneinfo'), | |
TZDate = zoneinfo.TZDate, | |
countrycodes = require('/www/utils/node_modules/zoneinfo/lib/countrycodes'); | |
mongo = require('/www/utils/node_modules/mongoq'), | |
db = mongo('mongodb:\/\/localhost/logs'), | |
access = db.collection( 'access' ); |
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 Create_Country_Codes_Table { | |
/** | |
* Make changes to the database. | |
* | |
* @return void | |
*/ | |
public function up() |
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
-- bookmarklet | |
if( ( string.len( lighty.env["uri.path-raw"] ) == 81 or string.len( lighty.env["uri.path-raw"] ) == 82 ) and lighty.env["request.method"] == "GET" and lighty.env["uri.query"] and string.find( lighty.env["uri.query"], "u=" ) == 1 ) then | |
get = {} | |
for k, v in string.gmatch(lighty.env["uri.query"], "(%w+)=(%w+)") do | |
get[k] = v | |
end | |
if( get["u"] ) then | |
r = math.random(10000,1000000) | |
lighty.content = { [[ | |
function _UNIQUENAME]] .. r .. [[(){ |
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
url.query = function( url ) { | |
var parsed = this.parse( url, true, false ), | |
query = Object.keys( parsed.query ), | |
result = {}; | |
if( query.length > 0 ) { | |
query.forEach(function(key){ | |
if( key.match( /([^\[]+)\[([^\]]+)\]/g ) ) { | |
key.replace( /([^\[]+)\[([^\]]+)\]/g, function( $0, $1, $2 ) { | |
result[$1] = result[$1] || {}; | |
result[$1][$2] = parsed.query[key]; |
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 | |
# create stats | |
$c['folder']['logs'] = '/www/logs/'; | |
$c['folder']['stats'] = '/www/stats/htdocs/'; | |
$c['visitors']['bin'] = '/www/stats/visitors/visitors'; | |
$c['visitors']['options'] = '-A -m 100 --screen-info -Z -H -M -X -Y -S -r 200 -g 100 --max-adsensed 100 --trails --prefix'; | |
foreach( glob( $c['folder']['logs'].'access_*.log' ) as $logfile ) { |
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
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain l,s,u |
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 getmime( $url ) { | |
@exec( 'curl -s -I '.escapeshellcmd( $url ), $data ); | |
if( is_array( $data ) && count( $data ) > 3 ) { | |
$result = array(); | |
foreach( $data as $line ) { | |
if( stripos( $line, 'Content-Type:' ) !== false || stripos( $line, 'Content-Length:' ) !== false ) { | |
$line = explode( ':', $line ); | |
$line[1] = trim( $line[1] ); | |
$result[substr(strtolower($line[0]),8)] = ( is_numeric( $line[1] ) ) ? (int)$line[1] : $line[1]; |