Skip to content

Instantly share code, notes, and snippets.

@tarvitz
tarvitz / shell.py
Created July 4, 2014 08:59
Google App Engine remote(local) shell with ipython detection and small battaries inside
#!/usr/bin/env python
# coding: utf-8
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#!/usr/bin/env python
class A(object):
def __init__(self, obj):
self.obj = obj
def __repr__(self):
return str(self.obj)
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@tarvitz
tarvitz / settings.py
Created July 25, 2014 11:48
settings.py
# coding: utf-8
import os
PROJECT_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')
def rel(*path):
"""returns absolute path from topside (root) of the project
:param path: relative path
:return: absolute path
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import struct
def main():
with open('DRAKS0005.sl2', 'rb') as fo:
fo.seek(0x2c0, 0)
for slot in range(0, 10):
fo.seek(0x100, 1)