This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person(object): | |
def __init__(self): | |
self.age = 25 | |
self.name = "Jeft" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doodle = document.getElementById('hplogo'); | |
fakeEvt = {preventDefault:function(){}} | |
function getPowerVal(){ | |
if (ballCount==0){ | |
return 210; | |
} | |
if (ballCount < 31){ | |
return 120; |