Skip to content

Instantly share code, notes, and snippets.

@tylerflint
tylerflint / request.xml
Created January 3, 2012 19:36
Endeca request/response
<Query>
<RecordsSet>true</RecordsSet>
<Dimensions>true</Dimensions>
<BusinessRulesResult>true</BusinessRulesResult>
<AppliedFilters>true</AppliedFilters>
<Searches>
<Search>
<search-key>primary</search-key>
<search-term>A4527</search-term>
</Search>
@tylerflint
tylerflint / gist:1541139
Created December 30, 2011 19:28
wacko regex
# cron schedule regex:
#
# Needed a way to break this monster into nibblets.
# It all gets combined in the end for the most horrific regex i've ever seen!
#
# minute:
# list: (([0-5]?[0-9]),)+([0-5]?[0-9])
# mod: (0|\*)\/[0-5]?[0-9]
# expl: [0-5]?[0-9]
# final: ((0|\*)\/[0-5]?[0-9]|[0-5]?[0-9]|(([0-5]?[0-9]),)+([0-5]?[0-9])|\*)
@tylerflint
tylerflint / gist:1469025
Created December 12, 2011 20:48
monetdb create binary import
#!/usr/bin/env ruby
require 'rubygems'
require 'mongo'
db = Mongo::Connection.new.db('monet')
coll = db.collection('web_requests')
File.open('/Users/tylerflint/Desktop/monet-import.sql', 'a+') do |f|
@tylerflint
tylerflint / gist:1453869
Created December 9, 2011 23:46
iptables default policy load
#! /bin/sh
### BEGIN INIT INFO
# Provides: iptables
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: iptables
# Description: loads iptables default policy
@tylerflint
tylerflint / gist:1449712
Created December 9, 2011 01:40
odbc test
#!/usr/bin/env escript
main([]) ->
odbc:start(),
Result = odbc:connect("DRIVER={MonetDB};Server=localhost;Port=50000;UID=monetdb;PWD=monetdb;DATABASE=pagoda-stats", []),
io:format("Result: ~p~n", [Result]).
@tylerflint
tylerflint / gist:1449194
Created December 8, 2011 23:17
web_requests create table
CREATE TABLE "web_requests"
("app_id" varchar(50)
,"component_id" varchar(50)
,"cookie" varchar(50)
,"duration" integer
,"path" varchar(2000)
,"created_at" timestamp
);
@tylerflint
tylerflint / gist:1443959
Created December 7, 2011 18:22
original Net::Http call to endeca
@request, @raw_response = @http.post(@uri.path, @query.target!, 'Content-type' => 'application/xml')
@tylerflint
tylerflint / gist:1418519
Created December 1, 2011 17:48
idb.pagodabox.com
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="keywords" content="idb" />
<meta name="description" content="idb" />
<link rel="stylesheet" href="http://idb.pagodabox.com/css/style.css" />
</head><body>
<header>
<a href="http://idb.pagodabox.com/" class="logo">IDB</h1>
@tylerflint
tylerflint / gist:1401492
Created November 28, 2011 18:47
terminal colors
# Colors ----------------------------------------------------------
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
alias ls='ls -G'
# Setup some colors to use later in interactive shell or scripts
export COLOR_NC='\033[0m' # No Color
export COLOR_WHITE='\033[1;37m'
@tylerflint
tylerflint / gist:1365717
Created November 15, 2011 00:39
test sql
CREATE TABLE lyon_farts (
type varchar(25),
duration int,
severity int,
);
INSERT INTO lyon_farts VALUES ('sbd', 2, 5);
INSERT INTO lyon_farts VALUES ('pop', 1, 2);
INSERT INTO lyon_farts VALUES ('shard', 3, 10);