Skip to content

Instantly share code, notes, and snippets.

View tyteen4a03's full-sized avatar

Timothy Choi tyteen4a03

View GitHub Profile
class Foo(object):
baz = 15
@staticmethod
def bar():
return Foo.baz
class Spam(Foo):
baz = 20
s = Spam()
<section>
<h1 class="h3">{{ galleryTitle }} (click on each picture to enlarge image)</h1>
{% for image, caption in galleryContent|batch(5) %}
<div style="margin: auto;">
<a rel="{{ galleryID }}" href="{{ image }}" class="swipebox" title="{{ caption }}">
<img src="{{ image }}" alt="image" style="width: 15%; height: auto;">
</a>
</div>
{% endfor %}
</section>
Minimum Requirements:
CPU: Intel Pentium D or AMD Athlon 64 (K8) 2.6 GHz
RAM: 2GB
GPU (Integrated): Intel HD Graphics or AMD (formerly ATI) Radeon HD Graphics with DirectX 9.0c
GPU (Discrete): Nvidia GeForce 8400 or AMD Radeon HD 2400 with DirectX 9.0c
HDD: 700MB
OS: Windows Vista, Mac OSX 10.6
Mouse and Keyboard
Internet connection
Minimum Requirements:
CPU: Intel Pentium D or AMD Athlon 64 (K8) 2.6 GHz
RAM: 2GB
GPU (Integrated): Intel HD Graphics or AMD (formerly ATI) Radeon HD
Graphics with DirectX 9.0c
GPU (Discrete): Nvidia GeForce 8400 or AMD Radeon HD 2400 with DirectX 9.0c
HDD: 700MB
OS: Windows Vista, Mac OSX 10.6
Mouse and Keyboard
Internet connection (ADSL or better)
def funThings(result):
doSomeOtherStuff()
d = thingThatReturnADeferred()
d.addCallback(funThings) # passing function object, not calling the function
# ... class
if msg.startswith("@top"):
def ladder(result):
parseResultLoginHere(result)
api_ladder = getPage("http://a.scrollsguide.com/ranking?limit=10&fields=name,rating,rank", method='GET', postdata=None, headers=None, agent="User-Agent\", \"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36", timeout=0, cookies=None, followRedirect=True, redirectLimit=20, afterFoundGet=False)
api_ladder.addCallback(ladder)
import MySQLdb
import csv
import time
import traceback
import warnings
warnings.filterwarnings('ignore', category=MySQLdb.Warning)
def handle_yes_no(input):
@echo off
java -Xms1024M -Xmx1024M -jar minecraft_server.jar nogui
pause
@tyteen4a03
tyteen4a03 / gist:1dfd4f79fee84d1f93d4
Created December 7, 2014 23:14
SO mysql_ comment
javascript:(function(){if($("%23question textarea[name=comment]").length <=0){$("%23question .comments-link").click();}$("%23question textarea[name=comment]").val("[**Please, don't use `mysql_*` functions in new code**](http://bit.ly/phpmsql). They are no longer maintained [and are officially deprecated](https://wiki.php.net/rfc/mysql_deprecation). See the [**red box**](http://j.mp/Te9zIL)%3F Learn about [*prepared statements*](http://j.mp/T9hLWi) instead, and use [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli) - [this article](http://j.mp/QEx8IB) will help you decide which. If you choose PDO, [here is a good tutorial](http://j.mp/PoWehJ).");})();
@tyteen4a03
tyteen4a03 / gist:abb9433dded48adf270f
Created February 9, 2015 02:23
Shopify slice bug
<span class="test1">{{ "abcde" | slice: 0, -2 }}</span>
<span class="test2">{{ "abcde" | slice: -2, 0 }}</span>
<span class="test3">{{ "abcde" | slice: 1, -2 }}</span>
<span class="test4">{{ "abcde" | slice: -2, 1 }}</span>
<span class="test5">{{ "abcde" | slice: 0, 1 }}</span>
<span class="test6">{{ "abcde" }}</span>