Skip to content

Instantly share code, notes, and snippets.

@magicaltrevor
magicaltrevor / ha_sphinx.h.patch
Created September 1, 2011 14:44
patch for mysqlse/ha_sphinx.h put it in the same directory as source and run patch --dry-run -p0 -i ha_sphinx.h.patch then patch -p0 -i ha_sphinx.h.patch if no errors
*** ha_sphinx.h 2011-09-01 10:33:12.000000000 -0400
--- ha_sphinx.h.new 2011-09-01 10:33:01.000000000 -0400
***************
*** 1,5 ****
//
! // $Id: ha_sphinx.h 2428 2010-08-03 11:38:09Z shodan $
//
#ifdef USE_PRAGMA_INTERFACE
--- 1,5 ----
@magicaltrevor
magicaltrevor / ha_sphinx.cc.patch
Created September 1, 2011 14:46
patch for mysqlse/ha_sphinx.cc put it in the same directory as source and run patch --dry-run -p0 -i ha_sphinx.cc.patch then patch -p0 -i ha_sphinx.cc.patch if no errors
*** ha_sphinx.cc 2011-09-01 10:33:06.000000000 -0400
--- ha_sphinx.cc.new 2011-09-01 10:32:49.000000000 -0400
***************
*** 1,5 ****
//
! // $Id: ha_sphinx.cc 2752 2011-03-29 08:21:05Z tomat $
//
//
--- 1,5 ----
@magicaltrevor
magicaltrevor / incompetent.php
Created April 24, 2012 22:20
More incompentency
} elseif (isset($_SERVER['SOME_GLOBAL_VARIABLE'])) {
$default_context = $_SERVER['SOME_GLOBAL_VARIABLE'];
self::log('Found SERVER SOME_GLOBAL_VARIABLE');
} elseif (isset($_ENV['SOME_GLOBAL_VARIABLE'])) {
$default_content = $_ENV['SOME_GLOBAL_VARIABLE'];
self::log('Found ENV SOME_GLOBAL_VARIABLE');
} else {
...
if ($default_context == 'search' || $default_content == 'api') {
@magicaltrevor
magicaltrevor / windows.h__.js
Created November 18, 2012 23:59
windows.h.js INFINITY
var ffi = require('ffi'),
ref = require('ref'),
Struct = require('ref-struct'),
Library = require('./Library'),
Type = ref.Type,
NULL = ref.NULL,
isNull = ref.isNull;
var groups = ['libs', 'types', 'structs', 'callbacks', 'enums'];
<catalog xmlns="http://acalog.com/catalog/1.0" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:a="http://www.w3.org/2005/Atom" xmlns:xi="http://www.w3.org/2001/XInclude" id="acalog-catalog-11" >
<programs>
<program id="acalog-program-6595" >
<a:title xmlns:a="http://www.w3.org/2005/Atom" >Test Xinclude</a:title>
<code/>
<parent xmlns:xi="http://www.w3.org/2001/XInclude" >
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" xi:xpointer="xmlns(c=http://acalog.com/catalog/1.0) xpointer((//c:hierarchy/c:entity[@id='acalog-entity-763']))" >
<xi:fallback>Eastern Michigan University</xi:fallback>
</xi:include>
</parent>
>>> def instiClass(name,attributes_dict,extends=None,functions_list=None):
... if extends:
... class klass(eval(extends)): pass
... else:
... class klass: pass
... for key,value in attributes_dict.items():
... setattr(klass, key, value)
... if functions_list:
... for func in functions_list:
... setattr(klass,func.__name__, func)
@magicaltrevor
magicaltrevor / isTheWebsiteDown.js
Last active August 29, 2015 14:08 — forked from Marak/isTheWebsiteDown.js
Checks to see if a website is down
var http = require('http');
var urlparams = '/api/hermes_msoe_prod/systems/listSystemItems/{"system":"curriculog","id":"18","itemType":"core","template":"True"}';
module['exports'] = function isTheWebSiteDown (hook) {
http.get(hook.params.url + urlparams, function(res){
hook.debug(hook.params.url + urlparams + " is up and running.")
hook.res.end(hook.res.read());
}).on('error', function (){
hook.debug(hook.params.url + urlparams + " is DOWN!")
hook.res.end('true');
This file has been truncated, but you can view the full file.
# flapjacks_and_sasquatches_dice
v 1.572017 -33.726002 6.936993
v 1.593304 -33.702614 6.997502
v 1.570440 -33.702282 7.008665
v 1.545229 -33.726002 6.948898
v 1.489930 -33.726002 6.973475
v 1.515995 -33.701485 7.035245
v 1.484023 -33.701015 7.050855
v 1.461280 -33.726002 6.986209
v 1.405981 -33.726002 7.010786