Skip to content

Instantly share code, notes, and snippets.

View jasonsperske's full-sized avatar

Jason Sperske jasonsperske

View GitHub Profile
@jasonsperske
jasonsperske / FizzBuzz.py
Created July 19, 2012 16:41
Fizz/Buzz in Python
# My First Python program
# Based on this spec: http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html
def fbFilter(n): return n % 5 == 0 or n % 3 == 0
def fbPrinter(n):
if n % 15 == 0:
return 'FizzBuzz'
elif n % 5 == 0:
return 'Buzz'
@jasonsperske
jasonsperske / FizzBuzzAI.py
Created July 20, 2012 17:52
My Second Python program
# My Second Python program
# Based on this spec: http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html
import time
import random
def fbFilter(n): return n % 5 == 0 or n % 3 == 0
def fbTranslator(n):
output = '{0}'.format(n)
@jasonsperske
jasonsperske / FizzBuzz-Clean.py
Created July 20, 2012 18:02
A cleaner Fizz/Buzz in Python
# My Third Python program
# Based on this spec: http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html
import time
import random
def fbPrinter(simulator, translator, i):
time.sleep(simulator(i))
print(translator(i))
@jasonsperske
jasonsperske / q12944362-programmatic-binding-of-accelerators-in-wxpython.py
Created October 18, 2012 17:06
Solution to binding a lambda to an event in wxPython with arguments
import wx
class MyForm(wx.Frame):
#----------------------------------------------------------------------
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "Programmatic binding of accelerators in wxPython", size=(450,150))
# Add a panel so it looks the correct on all platforms
panel = wx.Panel(self, wx.ID_ANY)
list_of_lists=[]
category=0
list_of_lists.append([])
f = open("list.txt",'r')
for line in f.readlines():
item = line.strip('\n') # no white spaces in the list
if len(item) > 0:
#add to current category
@jasonsperske
jasonsperske / build-bootstrap.bat
Last active December 11, 2015 06:40 — forked from anonymous/my-bootstrap.bat
A batch file that can run on a Windows workstation with Node.js, JSHint, Recess, and UglifyJS to compile Twitter Bootstrap
@ECHO OFF
REM
REM 01.17.2013, Requires Node.js, JSHint, Recess, and UglifyJS (installed in the path)
REM Run this command after node.js is installed
REM npm install -g less jshint recess uglify-js
REM
MKDIR bootstrap\img
MKDIR bootstrap\css
MKDIR bootstrap\js
from math import pow
from cmath import sqrt
print "Quadradtic Formula Calculator!!!"
print "Ax²+Bx+C=0"
print "This solve for x"
a = input("Please, enter value for A: ")
b = input("Please, enter value for B: ")
c = input("Please, enter value for C: ")
using System;
using System.Collections.Generic;
namespace so15415825
{
class Program
{
static void Main(string[] args)
{
var badguys = new List<Badguy>()
import java.util.ArrayList;
import java.util.List;
public class PrimeFactorsOf {
public static void main(String ... args) {
System.out.println(primeFactorsOf(19252389595L));
}
static List<Long> primeFactorsOf(long val) {
long n = val;
@jasonsperske
jasonsperske / README.md
Last active December 16, 2015 07:39
JavaScript Obfuscator

Based on @VisioN's profile signature in StackOverflow, turned into a configurator that anyone can use.