Skip to content

Instantly share code, notes, and snippets.

View NordomWhistleklik's full-sized avatar

Anthony Allan NordomWhistleklik

  • Galactic Edge
  • Saint Paul, MN
View GitHub Profile
@NordomWhistleklik
NordomWhistleklik / fibonacci.py
Created October 11, 2012 17:09
[Python] Function for finding the nth number in a Fibonacci sequence
def get_fib(n, start):
'''(int, int) -> int
Returns the nth Fibonacci number where start defines whether the squence
starts at 0 or 1 and n is a whole number greater than or equal to 1
>>>get_fib(1,0)
0
>>>get_fib(1,1)
1
@NordomWhistleklik
NordomWhistleklik / cf-upload.py
Created November 2, 2012 16:59
Simple script to batch upload to Rackspace's Cloud Files
## Written for Python 2.7.3
## Anthony Allan
## Free to use and reproduce
## This script is built for batch uploading
## files to your Rackspace Cloud Files account.
## Requires bindings for cloudfiles found here,
## https://github.com/rackspace/python-cloudfiles
# os, sys, and msvcrt are default libraries
@NordomWhistleklik
NordomWhistleklik / autorun.inf
Created December 19, 2012 02:18
Autorun multiple exe's (such as GOG installers) on cd or dvd
[autorun]
open=batch_install.bat
@NordomWhistleklik
NordomWhistleklik / cf_delete.py
Created January 2, 2013 15:21
Python script for deleting all contents of a Cloud Files container
# Delete all contents of a Cloud Files container
import cloudfiles
username = ''
key = ''
containerName = ''
connection = cloudfiles.get_connection(username,key)
container = connection.create_container(containerName)
#!/usr/bin/env python
import sys
import os
import ssl
try:
import cloudfiles
except ImportError:
sys.exit("cloudfiles module missing. Please install before running.")
try:
@NordomWhistleklik
NordomWhistleklik / fsql.py
Created October 7, 2015 04:48 — forked from jcarbaugh/fsql.py
convert a MySQL dump into SQLite
#!/usr/bin/env python
# Convert a mysql dump into a sqlite-compatible format.
# I wrote this for just one script... no guarantess that it will work with others...
# python fsql.py < mysqldump.sql > readyforsqlite.sql
import re
import sys
content = sys.stdin.read()