This file contains 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
qstat: Usage for '## <params>': | |
qstat: ----- __Aliasing__ | |
qstat: -a - Add an alias | |
qstat: -c - Check an alias | |
qstat: -e - Edit an alias | |
qstat: -r - Remove an alias | |
qstat: ----- __Querying__ | |
qstat: -h - List of hosts to report/query from. | |
qstat: -p - Player name to search for in output of -c or -h | |
qstat: -g - Game type to use to query. |
This file contains 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
""" | |
Scanner: match text to generate tokens. | |
Adam Blinkinsop <blinks@acm.org> | |
First, construct a scanner with the tokens you'd like to match described as | |
keyword arguments, using Python-syntax regular expressions. | |
WARNING: Group syntax in these expressions has an undefined effect. | |
>>> simple = Scan(ID=r'\w+') | |
This file contains 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 | |
import logging | |
import random | |
import re | |
import sys | |
ROLL = re.compile(r'(\d*)d(\d+)') | |
def roll(dice): | |
"""Randomly generate the result of a dice roll. |
This file contains 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
def seven_seg(x): | |
''' | |
_ _ _ _ _ _ _ _ | |
|_||_| ||_ |_ |_| _| _| || | | |
_||_| ||_| _| | _||_ ||_| | |
1111101101 = 1005 | |
1101110001 = 881 | |
1101111100 = 892 |
This file contains 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
def extract_form_fields(self, soup): | |
"Turn a BeautifulSoup form in to a dict of fields and default values" | |
fields = {} | |
for input in soup.findAll('input'): | |
# ignore submit/image with no name attribute | |
if input['type'] in ('submit', 'image') and not input.has_key('name'): | |
continue | |
# single element nome/value fields | |
if input['type'] in ('text', 'hidden', 'password', 'submit', 'image'): |
This file contains 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/awk -f | |
# md2html.awk | |
# by: Jesus Galan (yiyus) <yiyu.jgl@gmail>, May 2009 | |
# Usage: | |
# md2html file.md > file.html | |
# Options: -v esc=false to not escape html | |
function newblock(nblock){ | |
if(text) |
This file contains 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
# /etc/skel/.bash_profile | |
# This file is sourced by bash for login shells. The following line | |
# runs your .bashrc and is recommended by the bash info pages. | |
[[ -f ~/.bashrc ]] && . ~/.bashrc |
This file contains 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
################ | |
# INSTALLATION # | |
################ | |
There should be no weird php.ini variables to set, so just move this to a server and set the appropriate permissions. | |
If you want to make it so a URL can be parsed as http://foo.bar/proxy/param1/param2/paramn, you can utilise a .htaccess | |
file to do this. | |
First, rename proxy.php to proxy and then put a .htaccess file in the same directory as proxy with the following information: | |
<Files proxy> |
This file contains 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/perl | |
use strict; | |
use warnings; | |
use Compress::Raw::Bzip2; | |
use Graph::Undirected; | |
use Storable; | |
use Term::ReadLine; # Term::ReadLine::Gnu | |
$|=1; | |
my $root = 'Kevin_Bacon'; # dbpedia resource name of an actor |
This file contains 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 -*- | |
"""[application description here]""" | |
__appname__ = "[application name here]" | |
__author__ = "Stephan Sokolow (deitarion/SSokolow)" | |
__version__ = "0.0pre0" | |
__license__ = "GNU GPL 3.0 or later" | |
import logging |
OlderNewer