- a bigger project
- first subtask #1234
- follow up subtask #4321
- final subtask cc @mention
- a separate task
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Detect Scroll Position and act</title> | |
<!-- CSS --> | |
<style type="text/css"> |
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
from compat import import_string | |
from django.conf import settings | |
for app_name in settings.INSTALLED_APPS: | |
app = __import__(app_name) | |
print "Information for " + app_name | |
try: | |
print "verion: " + app.__version__ | |
except Exception as e: | |
print "version: " + str(e) |
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
from django.core import urlresolvers | |
from django.contrib.contenttypes.models import ContentType | |
from django.db import models | |
class MyModel(models.Model): | |
def get_admin_url(self): | |
content_type = ContentType.objects.get_for_model(self.__class__) | |
return urlresolvers.reverse("admin:%s_%s_change" % (content_type.app_label, content_type.model), args=(self.id,)) |
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 atexit | |
import os | |
import sys | |
try: | |
import readline | |
except ImportError: | |
print "Module readline not available." | |
else: | |
import rlcompleter | |
readline.parse_and_bind('tab:complete') |
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 | |
# | |
# Proof of Concept: UDP Hole Punching | |
# Two client connect to a server and get redirected to each other. | |
# | |
# This is the client. | |
# | |
# Koen Bollen <meneer koenbollen nl> | |
# 2010 GPL | |
# |
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
find -type f -name "*.pyc" -delete |
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
# A complete list of available directives id available on: | |
# https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior | |
from datetime import datetime | |
now = datetime.now() | |
print now.strftime('%d. %b %Y') # 17. Sep 2014 | |
print now.strftime('%d.%m.%y') # 17.09.14 | |
#"%D %d %M %Y" -> 'Wed 09 Jan 2008' |
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
[3bot-settings] | |
BOT_ENDPOINT=* | |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html