Skip to content

Instantly share code, notes, and snippets.

View rkulla's full-sized avatar

Ryan Kulla rkulla

  • Southern California
View GitHub Profile
@rkulla
rkulla / curslotto.c
Created March 21, 2014 02:07
Lottery number generator with an ncurses interface
/* curslotto.c
* Lotto number generator -by Ryan Kulla
* Compile with: gcc -o curslotto curslotto.c -lncurses
*
* Lottery number generator
*
* Usage: curslotto <num1> <num2> <num3> <num4> <num5> <num6> [slow]
*
* Examples:
*
@rkulla
rkulla / django-skeleton.sh
Last active August 29, 2015 14:03
Django Skeleton Script
#!/bin/bash
# django-skeleton by Ryan Kulla <rkulla@gmail.com>
# Sets up my prefered Django project layout. Creates a virtualenv with
# django-toolbelt django-debug-toolbar and django-coverage. And creates
# an initial local Git repository.
default_packages=(django-toolbelt django-debug-toolbar django-coverage)
root_folder="$1"
project_name="$2"
root_basename=$(basename "$root_folder")
@rkulla
rkulla / binanim.py
Created July 26, 2011 15:25
Binary Animation with Pygame
#!/usr/bin/env python
"""
Description: Binary animation screensaver
Usage: python binanim.py
Strike a key or move the mouse to exit.
You can pass the class constructor a dictionary of config values:
@rkulla
rkulla / create_english_list.php
Last active September 26, 2015 13:48
Create english list function
<?php
/**
* Create English List
*
* I wrote this in 2007 for a project I was working on.
*
* Converts arrays like (1,2,3) to a list in English like: "1, 2 and 3"
* If only two array elements exist it returns: "1 and 2"
* If only one array element exists it returns: "1"
* If zero array element exists it returns: ""
@rkulla
rkulla / pcollab.pl
Last active September 26, 2015 15:07
XChat Script for project collaboration over IRC
#!/usr/bin/perl -w
# I wrote this in ~2002 as a proof of concept
# Sample X-Chat script to make IRC project collaboration easier.
$password = "Pcollab_Password"; # Project password
@nicks = ("nick1", "nick2", "nick3"); # Array of nicks working on the project
IRC::register("Pcollab Script", "0.1", "", "");
IRC::print "Loading Pcollab Script...\n";
IRC::add_message_handler("PRIVMSG", "privmsg_handler");
@rkulla
rkulla / gotmail.pl
Last active September 26, 2015 15:08
Daemon to play sound alert when you have new E-Mail
#!/usr/bin/perl -w
# gotmail.pl -By Ryan Kulla
# I wrote this in the '90s to help learn perl
# Notifies you audibly when you have new mail.
# Created for fun. Rename to gotmaild, add to startup scripts, to make real daemon.
use POSIX;
$MAILBOX = "/path/to/mbox"; # change this to your actual mailbox
$PLAY_SOUND = "mplayer /path/to/alert.mp3"; # change to preferred player and sound file
@rkulla
rkulla / joescan.py
Last active September 26, 2015 15:17
Joe account Scanner
#!/usr/bin/env python
# joescan.py -By Ryan Kulla
# I wrote this in ~1999 as one of my first python programs
# Scans for user accounts who use their username as their password.
from crypt import crypt
from pwd import getpwall, getpwnam
from getpass import getuser
PASSWD_FILE = getpwall()
@rkulla
rkulla / portell.py
Last active September 26, 2015 15:57
Look up a BSD system's Port package's description instantly
#!/usr/bin/env python
# portell.py -by Ryan Kulla
# I wrote this in ~2001 just for fun
# Description: Lookup a BSD (FreeBSD, et al) system's Port package's description instantly.
# Creates an index of existing Ports for easy and quick look up.
# Usage: portell.py <portname>
import sys, os, shelve
try:
@rkulla
rkulla / gwhich.c
Created August 4, 2011 06:39
GTK+ front-end wrapper around the UNIX which(1) command
/* gwhich.c -by Ryan Kulla
* GTK+ front-end wrapper around the which(1) command.
* Compile with: gcc gwhich.c -o gwhich `pkg-config --cflags --libs gtk+-2.0`
* Usage: gwhich
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <gtk/gtk.h>
@rkulla
rkulla / bq.py
Created November 7, 2015 17:47
BigQuery CLI query to json
#!/usr/bin/env python
# Query Big Query and return JSON results.
# Just a python example. There are better CLI tools than this:
# https://cloud.google.com/bigquery/bq-command-line-tool?hl=en
# usage: python bq.py
# For pretty output, pipe to 'prettyjson' or json.tool and/or pygmentize:
# bq.py | python -m json.tool | pygmentize -l javascript
from apiclient.discovery import build
from oauth2client.client import SignedJwtAssertionCredentials