Skip to content

Instantly share code, notes, and snippets.

View systemsoverload's full-sized avatar

TJ Kells systemsoverload

View GitHub Profile
class Person(object):
def __init__(self):
self.age = 25
self.name = "Jeft"
sv_cheats 1
mp_autoteambalance 0
mp_limitteams 0
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
@systemsoverload
systemsoverload / gamera_test.lua
Created March 12, 2014 02:56
Minimal Gamera Bound Love2d World
-- print program output to ST console
io.stdout:setvbuf("no")
local gamera = require 'gamera'
local min, max = math.min, math.max
-- game variables (entities)
local world, player, target, cam1
def compute_something(values):
for v in values:
if v < 100:
raise Exception("Thats not a big enough number!")
else:
print("good dats the right amount")
try:
compute_something([100, 200, 300, 400, 500, 1501025, 1250015, 125005])
except:
#Throws exception IndexError
names = [["TJ","Kells"], ["Erin","Wilbur"],["JEFFEREY"]]
for name in names:
first_name = name[0]
last_name = name[1]
print first_name, last_name
@systemsoverload
systemsoverload / pong.py
Created January 4, 2014 00:05
PySDL2 based pong implementation
import sys
try:
from sdl2 import *
import sdl2.ext as sdl2ext
except ImportError:
import traceback
traceback.print_exc()
sys.exit(1)
WHITE = sdl2ext.Color(255, 255, 255)
myFramework = {
viewport: {
height: "800"
, width: "800"
, color: "#cdcdcd"
, components: []
, render: function(){
//Destory viewport if it already exists
var existingVp = document.getElementById('myFramework-viewport');
if (existingVp){
from tastypie.fields import ToManyField
class ConditionalRelatedField(ToManyField):
truthy = set('1', 'true', 'yes')
def dehydrate_related(self, bundle, related_resource):
full = bundle.request.GET.get('include_entitites', '').lower()
if full not in self.truthy:
return related_resource.get_resource_uri(bundle)
else:
@systemsoverload
systemsoverload / gist:4113328
Created November 19, 2012 19:48
Raphael Object Connector
Raphael.fn.connection = function (obj1, obj2, color, bg) {
if (obj1.line && obj1.from && obj1.to) {
line = obj1;
obj1 = line.from;
obj2 = line.to;
}
var bb1 = obj1.getBBox()//Bounding box of the connectFrom node
, bb2 = obj2.getBBox() //Bounding box of the connectTo node
, connectionPoints // potential connecting points on the edge of the objects
@systemsoverload
systemsoverload / gist:3296078
Created August 8, 2012 15:42
Google Doodle 08/08 AimBot
doodle = document.getElementById('hplogo');
fakeEvt = {preventDefault:function(){}}
function getPowerVal(){
if (ballCount==0){
return 210;
}
if (ballCount < 31){
return 120;