Skip to content

Instantly share code, notes, and snippets.

View davidreuss's full-sized avatar

David Reuss davidreuss

View GitHub Profile
@davidreuss
davidreuss / keybase.md
Created January 17, 2017 09:53
keybase.md

Keybase proof

I hereby claim:

  • I am davidreuss on github.
  • I am davidreuss (https://keybase.io/davidreuss) on keybase.
  • I have a public key whose fingerprint is A3DA D291 2BB8 148F D915 8D9B 2C35 96D6 D000 B38E

To claim this, I am signing this object:

@davidreuss
davidreuss / keybase.md
Created January 28, 2015 11:27
keybase.md

Keybase proof

I hereby claim:

  • I am davidreuss on github.
  • I am davidreuss (https://keybase.io/davidreuss) on keybase.
  • I have a public key whose fingerprint is 66A8 9B03 C960 334E 6670 1232 B26C A5EE 635A 8528

To claim this, I am signing this object:

@davidreuss
davidreuss / MyController.php
Created June 21, 2013 10:39
Silex controller skeleton
<?php
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
abstract class MyController {
protected $request;
protected $application;
public function __construct(Request $req, Application $app) {
@davidreuss
davidreuss / pvr-folder-cleanup.php
Created February 3, 2012 23:04
pvr-cleanup -- for a friend.
<?php
$root = dirname(__FILE__);
$pvr_record_folder = "{$root}/PVRRECORD";
$will_rename = array();
$count_map = array();
foreach (glob("${pvr_record_folder}/*.pvr", GLOB_ONLYDIR) as $folder) {
$folder = basename($folder);
@davidreuss
davidreuss / named.conf
Created August 22, 2011 10:53
typical zone file
zone "example.com" IN {
type master;
file "/zones/example.com";
}
zone "foobar.com" IN {
type master;
file "/zones/default";
}
@davidreuss
davidreuss / mysql_qps.sql
Created May 25, 2011 09:17
mysql queries per. second estimated
SELECT MAX( -- use MAX to force aggregation
IF(variable_name='Questions' -- no. of queries sent to server
, CAST(variable_value AS unsigned) -- make integer value
, 0 -- ignore if not 'Questions'
)
)
/ -- divide by
MAX( -- use MAX to force aggregation
IF(variable_name='Uptime' -- no. of seconds the server is up
, CAST(variable_value AS unsigned) -- make integer value
@davidreuss
davidreuss / gist:980512
Created May 19, 2011 10:28
php setter foo
<?php
$foo->set1(1)
->set2(2)
->set3(3);
// vs.
$foo->set1(1);
$foo->set2(2);
$foo->set3(3);
@davidreuss
davidreuss / testing gist
Created February 10, 2011 14:42
just a test
this is awesome
@davidreuss
davidreuss / couchdb_crash_reports.txt
Created October 26, 2010 09:11
couch crashes - hard
=ERROR REPORT==== 26-Oct-2010::13:08:07 ===
** Generic server <0.14323.25> terminating
** Last message in was {'EXIT',<0.14322.25>,
{'EXIT',
{{badmatch,
{error,
{emfile,
[{erlang,open_port,
[{spawn,
"/usr/lib64/erlang/lib/couch-0.11.2/priv/couchspawnkillable /usr/bin/couchjs /usr/share/couchdb/server/main.js"},
@davidreuss
davidreuss / scrape-fu.php
Created September 13, 2010 17:55
scrape-fu
<?php
require 'phpQuery/phpQuery.php';
$prefix = 'http://fyrrum.dk/portal.php';
$doc = phpQuery::newDocumentHTML(file_get_contents(
$prefix
));
$captures = array();