This file contains 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
""" | |
Type coercion for sqlalchemy prior to committing to some database. | |
http://stackoverflow.com/questions/8980735/how-can-i-verify-column-data-types-in-the-sqlalchemy-orm | |
""" | |
from sqlalchemy import ( | |
Column, | |
Integer, | |
String, |
This file contains 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
Downloading/unpacking unittest2py3k (from stormpath-sdk->-r ./requirements/requirements.txt (line 40)) | |
Running setup.py egg_info for package unittest2py3k | |
Traceback (most recent call last): | |
File "<string>", line 16, in <module> | |
File "/tmp/pip_build_root/unittest2py3k/setup.py", line 12, in <module> | |
from unittest2 import __version__ as VERSION | |
File "unittest2/__init__.py", line 61, in <module> | |
from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf, | |
File "unittest2/case.py", line 539 | |
def assertAlmostEqual(self, first, second, *, places=None, msg=None, |
This file contains 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 requests | |
urls = open("vidurls.txt", "r").read().split() | |
results = {} | |
for url in urls: | |
print "processing: ", url | |
try: |
This file contains 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
#!/bin/sh | |
# VBA and other emulators can save videos on their own, but this captures other windows too. | |
INFO=$(xwininfo -frame) | |
WIN_GEO=$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' |\ | |
grep -oEe '[0-9]+x[0-9]+') | |
WIN_XY=$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' |\ | |
grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/+/,/' ) |
This file contains 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
""" | |
Code that attempts to model a battle. | |
""" | |
from pokemontools.vba.vba import crystal as emulator | |
class BattleException(Exception): | |
""" | |
Something went terribly wrong in a battle. | |
""" |
This file contains 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 Test(object): | |
@staticmethod | |
def bark(message): | |
print "foo" | |
return message | |
T = bark.__func__("hello cruel world") |
This file contains 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
====================================================================== | |
ERROR: test_keyboard_typing_cap_name (test_vba.VbaTests) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/home/kanzure/code/pokemon-reverse-engineering-tools/tests/test_vba.py", line 260, in test_keyboard_typing_cap_name | |
self.assertEqual(name, self.cry.get_player_name()) | |
File "/home/kanzure/code/pokemon-reverse-engineering-tools/pokemontools/vba/vba.py", line 367, in get_player_name | |
name = translate_chars(bytez) | |
File "/home/kanzure/code/pokemon-reverse-engineering-tools/pokemontools/vba/vba.py", line 34, in translate_chars | |
result += chars[each] |
This file contains 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
#!/usr/bin/env python | |
import datetime | |
import json | |
import gtk | |
import gobject | |
# TODO: fix gi.repository.WebKit to have a working webview.get_dom_document | |
import webkit |
This file contains 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
In [12]: frame = browser.webview.get_main_frame() | |
In [13]: frame.get_global_context() | |
--------------------------------------------------------------------------- | |
TypeError Traceback (most recent call last) | |
<ipython-input-13-28813e0f64ff> in <module>() | |
----> 1 frame.get_global_context() | |
/usr/lib/python2.7/dist-packages/gi/types.py in function(*args, **kwargs) | |
111 @wraps_callable_info(info) |
This file contains 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
#!/usr/bin/python | |
############################################################## | |
# PyInstaller Win32 shellcode runner - by @mihi42 | |
# | |
# Needed software: | |
# * Python 2.7.2 from | |
# <http://www.python.org/download/releases/> | |
# * PyWin32 build 217 for Python 2.7 from | |
# <http://sourceforge.net/projects/pywin32/files/pywin32/> |