This file contains hidden or 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
#!/bin/bash | |
LOADING=false | |
usage() | |
{ | |
cat << EOF | |
usage: $0 [options] dbname | |
OPTIONS: |
This file contains hidden or 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
#!/bin/bash | |
PORT="8000" | |
usage() { | |
cat << EOF | |
usage: $0 host [port] | |
EOF | |
} |
This file contains hidden or 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
#!/bin/bash | |
cur=`pwd` | |
inotifywait -mqr --timefmt '%d/%m/%y %H:%M' --format '%T %w %f' \ | |
-e modify ./ | while read date time dir file; do | |
ext="${file##*.}" | |
if [[ "$ext" = "go" ]]; then | |
echo "$file changed @ $time $date, rebuilding..." | |
go build |
This file contains hidden or 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/bin/env python | |
# -*- coding: utf-8 -*- | |
""" """ | |
import json | |
from urllib2 import urlopen | |
from lxml.html import document_fromstring | |
from lxml.cssselect import CSSSelector as cs |
This file contains hidden or 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
// Selectable implements a simple interface which allows to get the inner text | |
// of some element as well as run a CSS select on it and get a list of nodes | |
type Selectable interface { | |
CssSelect(selector string) []Node | |
Text() string | |
} | |
// A node wrapper, in order to provide a similar interface in the future | |
// possibly without gokogiri | |
type Node struct { |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"fmt" | |
"github.com/moovweb/gokogiri" | |
"github.com/moovweb/gokogiri/css" | |
"github.com/moovweb/gokogiri/html" | |
"github.com/moovweb/gokogiri/xml" | |
"github.com/moovweb/gokogiri/xpath" |
This file contains hidden or 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
const ( | |
white = iota + 89 | |
black | |
red | |
green | |
yellow | |
blue | |
purple | |
) |
This file contains hidden or 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/bin/env python | |
# I had a script which I wanted to have a special option that short-circuited the normal | |
# argument parsing error handling behavior so that it could be run without thenormal | |
# required arguments. This option would work similar to how `--help` or `--version` | |
# works, except that the parser would return a valid args object in its presence | |
# rather than exiting the program. | |
import argparse |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"compress/gzip" | |
"database/sql/driver" | |
"errors" | |
"fmt" | |
"github.com/jmoiron/sqlx" | |
_ "github.com/mattn/go-sqlite3" |
This file contains hidden or 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
+++ Statistics Dump +++ (1393879884) | |
++ Incoming Requests ++ | |
7122195 QUERY | |
1 IQUERY | |
4 STATUS | |
1 NOTIFY | |
++ Incoming Queries ++ | |
5189989 A | |
81035 NS | |
1754 CNAME |