Skip to content

Instantly share code, notes, and snippets.

View ringmaster's full-sized avatar

Owen Winkler ringmaster

View GitHub Profile
@ringmaster
ringmaster / keybase.md
Created February 24, 2014 20:41
keybase.md

Keybase proof

I hereby claim:

  • I am ringmaster on github.
  • I am ringmaster (https://keybase.io/ringmaster) on keybase.
  • I have a public key whose fingerprint is 1ECB FD3E 9FD9 271F 4B8D C71D 8C65 3BD1 5B6A FAB1

To claim this, I am signing this object:

@ringmaster
ringmaster / sketch_jan30a.ino
Created January 30, 2014 23:29
My "first" Arduino sketch
int switchState = 0;
int lightOn = 0;
int led = 13;
void setup() {
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(2, INPUT);
pinMode(led, OUTPUT);
<?php
if(PHP_OS == 'WINNT') {
$CONFIG = array (
'datadirectory' => 'D:\owen\Documents\phpstorm\oc2\data',
'dbhost' => 'home.lise',
// Extra SSL options to be used for configuration
'openssl' => array(
'config' => 'C:\Program Files (x86)\iis express\PHP\v5.4\extras\openssl.cnf',
),
);
@ringmaster
ringmaster / results.csv
Created September 6, 2013 14:48
rework-autoloader results
run no autoloader cache APC
1 0.82526803 1.097486973
2 0.341663837 0.340631008
3 0.356065035 0.341625929
4 0.391163111 0.354048967
5 0.349993944 0.322378874
6 0.399251938 0.341935158
7 0.538627148 0.374629021
8 0.362586021 0.437278986
9 0.354948997 0.395817995
@ringmaster
ringmaster / timetest.php
Last active December 22, 2015 08:08
Autoloader tests
<?php
global $RUNTIME_NOAPPS;
$RUNTIME_NOAPPS = true;
define('PHPUNIT_RUN', 1);
require_once __DIR__.'/lib/base.php';
require_once __DIR__.'/lib/autoloader.php';
@ringmaster
ringmaster / gist:6346828
Created August 26, 2013 21:24
ownCloud clean script
#!/bin/bash
pushd /c/xampp/htdocs/vdr/master.oc.claire/htdocs
rm config/config.php
mysqladmin -f -s -uroot drop oc_master
mysqladmin -f -s -uroot create oc_master
rm -rf data/*
rm -rf data/.htaccess
#echo "<?php
#\$AUTOCONFIG = array(
# 'dbtype' => 'mysql',
@ringmaster
ringmaster / gist:6342696
Created August 26, 2013 15:26
Relevant parts of vhost config for XSendFile
SetEnv MOD_X_SENDFILE_ENABLED 1
XSendFile On
XSendFilePath /tmp/oc-noclean
@ringmaster
ringmaster / myplugin.plugin.php
Last active December 18, 2015 18:39
How Habari implments the WordPress code shown here: http://codex.wordpress.org/Settings_API
<?php
namespace Habari;
class MyPlugin extends Plugin
{
/* Implementing this function modifies the admin options form */
public function action_modify_form_admin_options(FormUI $form) {
// Add a wrapper for a new "example" section before the form buttons
<?php
//...
public function filter_final_output($buffer)
{
$regex = '%http://[^/]+?\.static\.flickr\.com/[0-9a-f/_]+\w?\.(jpg|png|gif)%i';
if(preg_match_all($regex, $buffer, $matches, PREG_SET_ORDER)) {
foreach($matches as $match) {
$hashfile = 'flickr.static.' . md5($match[0]) . '.' . $match[1];
if(!file_exists(HABARI_PATH . '/user/files/' . $hashfile)) {
PREFIX terms:<http://wiktionary.dbpedia.org/terms/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX dc:<http://purl.org/dc/elements/1.1/>
SELECT ?swordRes ?sword ?slang ?spos
FROM <http://wiktionary.dbpedia.org>
WHERE {
?swordRes rdfs:label ?sword .
?swordRes dc:language <http://wiktionary.dbpedia.org/terms/English> .
?swordRes dc:language ?slang .
?swordRes terms:hasPoS ?spos .