Skip to content

Instantly share code, notes, and snippets.

@Steve-V
Steve-V / randomfilerenamer.py
Created November 14, 2019 17:05 — forked from rickowski/randomfilerenamer.py
Python script to rename every file in a given folder to a random name, including the original file extension.
#!/usr/bin/python3
# Copyright © 2015 Ole Rickowski
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
import os,sys,random,string
# Print help
@Steve-V
Steve-V / .vimrc
Created January 25, 2015 23:31
pre-split vimrc
" make the user character ,
let mapleader = ","
" make qq work as escape, save your pinkies
inoremap qq <esc>
inoremap <esc> <nop>
vnoremap qq v
" move by visual line rather than hard line
" essentially that way you dont have to scroll
@Steve-V
Steve-V / vimiumrc
Last active August 29, 2015 14:04
Vimiumrc
map gn nextTab
map gt previousTab
map g9 firstTab
map g0 lastTab
map n createTab
map d removeTab
map u restoreTab
@Steve-V
Steve-V / gist:8513338
Created January 20, 2014 01:14
Windows + Stores
Store 1 Store 2 Store 3 Windows
Car Jewelry Cosmetics 0
Car Jewelry Suits 0
Car Pear Jewelry 0
Car Pear Cosmetics 2
Car Pear Suits 3
Pear Jewelry Cosmetics 6
Suits Jewelry Pear 6
Car Cosmetics Suits 12
Jewelry Cosmetics Suits 16
@Steve-V
Steve-V / explained.txt
Created May 18, 2012 15:43
The Knapsack Problem, in Python
The numbers in the table indicate the maximum value of the knapsack
The columns of the table indicate the maximum weight.
The rows of the table indicate which items you are allowed to place in the knapsack.
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] === no items
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] === red only
[0, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3] === red and gray
[0, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5] === red, gray, and blue
import random
#this game is a test your luck game.
#it will continue until the player dies or stops opening chests.
#every chest has a one in five chance of containing a grue because i love Zork
chest = ('gold' , 'gold' , 'gold' , 'grue' , 'gold')
print """
THE LUCKY CHEST GAME!
"""
@Steve-V
Steve-V / gist:1686828
Created January 27, 2012 03:33
breakfast
def main():
pass
if __name__ == '__main__':
main()
def spatula(food):
print(food)
return
@Steve-V
Steve-V / gist:1360063
Created November 12, 2011 04:55
Bash prompt to show current checkout
# Change prompt to display current git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/:\1/'
}
PS1="[\u@\h \W\$(parse_git_branch)]"
case `id -u` in
0) PS1="${PS1}# ";;
*) PS1="${PS1}$ ";;
esac
# end git branch code
@Steve-V
Steve-V / gist:1318915
Created October 27, 2011 06:32
seen.old.db
(dp0
S'kellyev'
p1
(S'#thegeekgroup'
p2
F1307326422.069239
tp3
sS'leadhead'
p4
(S'#thegeekgroup'
@Steve-V
Steve-V / gist:1191997
Created September 4, 2011 00:21
toast1
toast1