Skip to content

Instantly share code, notes, and snippets.

View ProfAvery's full-sized avatar

Kenytt Avery ProfAvery

  • California State University, Fullerton
  • Fullerton, CA
View GitHub Profile
#!/usr/bin/python2
"""Display the error message for an Oracle error either from the internet
or from the cache db, based on the error code ("the query") you get when
confronted with the error."""
import sys, os, re, urllib2, urlparse, anydbm
from BeautifulSoup import BeautifulSoup
BASE_URL = "http://download.oracle.com/docs/cd/B19306_01/server.102/b14219/"
TOC_URL = BASE_URL + "toc.htm"
#!/usr/bin/perl
# $Id: safetynet,v 1.10 2001/01/19 17:42:02 syntec Exp $
# Author : Evan Borgstrom ($Author: syntec $) at unixpimps.org
# Created : 2000/10/13
# Purpose : Keep things running without complicated init scripts.
# Modified: $Date: 2001/01/19 17:42:02 $
##################################################################
@need12648430
need12648430 / example.py
Last active December 2, 2015 21:04
Quarrel: WSGI-style routing for command line tools, in about 50 lines
import sys
from quarrel import Quarrel
@Quarrel("multiply", int, int)
@Quarrel("multiply", int)
def multiply_int(a, b = 2):
print(a * b)
@Quarrel("greet", str)
def greet(name):
@naftaliharris
naftaliharris / trypy
Last active January 2, 2016 09:39
An enhancement to the "python" executable that automatically launches you into a debugger if your code throws an exception.
#!/bin/bash
# An enhancement to the "python" executable that automatically launches you into the python debugger on error.
#
# Use it like you would the "python" executable, for example:
# $ trypy somefile.py
# or
# $ trypy somefile.py arg1 arg2
#
# EXAMPLE:
@tdl
tdl / pretty_print_YAML
Created July 9, 2013 09:57
Pretty print YAML with Ruby
ruby -ryaml -rpp -e "pp YAML.load(STDIN)" < infile > outfile
@chekunkov
chekunkov / pythonstartup.py
Last active January 19, 2017 00:25
PYTHONSTARTUP file example with custom displayhook
#!/usr/bin/env python
import sys
import pprint
def displayhook_pprint(o):
"""Display hook powered by pprint.
https://www.python.org/dev/peps/pep-0217/
1) Read an image from file
2) Display an image that you read from file
3) Capture Video using your webcam and display the feed
4) Display back and white live stream from your webcam.
5) Have a slider to change brightness of the webcam live stream. Display.
6) Have a slider to change contrast of the webcam live stream. Display.
7) Capture a snapshot from your webcam. Then display difference between live video stream and this snapshot. (Background subtraction)
8) Display Canny edge image from your live webcam stream
9) Have a slider to change smoothness / sharpness of image from live webcam stream.
10) Display histogram of colors (RGB) from your live webcam stream
@jkominek
jkominek / updatestars.py
Last active March 26, 2022 15:21
Maintain a mirror of all your Github stars.
#!/usr/bin/python
#################
# NOTE
# Now at https://github.com/jkominek/updatestars
#################
import requests
import json
import re
@ProfAvery
ProfAvery / query.py
Last active April 27, 2022 20:35
Simple SQLite query utility that can print GUIDs
#!/usr/bin/env python
import cmd
import sys
import uuid
import pprint
import sqlite3
def make_dicts(cursor, row):
@textarcana
textarcana / centos-install-syntax-highlighting-in-less.sh
Last active May 1, 2023 01:01
2020 update: just use bat(1) instead!!!! bat has git integration and also can show invisible characters! OLD STUFF: How to enable syntax-highlighting in less. Use `less -N` (or type -N while in less) to enable line numbers. Based on the procedure described in http://superuser.com/questions/71588
# Enable syntax-highlighting in less.
# Last tested on CentOS 6.3.
#
# First, add these two lines to ~/.bashrc
# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
# export LESS=" -R "
sudo yum -y install boost boost-devel ctags
wget http://springdale.math.ias.edu/data/puias/unsupported/6/x86_64/source-highlight-3.1.6-3.puias6.x86_64.rpm