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
| //a ugly http server, the worst ever made | |
| // Learning Processing | |
| // Daniel Shiffman | |
| // http://www.learningprocessing.com | |
| // Example 19-1: Simple therapy server | |
| // Import the net libraries | |
| import processing.net.*; |
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 __future__ import with_statement | |
| from fabric.api import local, settings, abort, run, cd, put, env, lcd | |
| from fabric.operations import local | |
| from fabric.contrib.console import confirm | |
| import os | |
| env.hosts = ['root@IP'] | |
| env.passwords = {'root@IP': 'PASSWORD'} | |
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
| # Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved | |
| from django.conf import settings | |
| from django.conf.urls.defaults import * | |
| from django.http import HttpResponsePermanentRedirect | |
| # Uncomment the next two lines to enable the admin: | |
| from django.contrib import admin | |
| admin.autodiscover() | |
| #admin.site.login_template = "rundb/login.html" |
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
| # Local settings for dev work | |
| import os.path as path | |
| TEST_INSTALL = True | |
| DEBUG = True | |
| ## NOTE: Without this, uses system installed postgres database, shared between instances. | |
| #DATABASES = { |
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
| export PYTHONPATH=/results/svn/TS/dbReports | |
| python manage.py runserver_plus --noreload 0.0.0.0:8000& | |
| watchmedo shell-command \ | |
| --patterns="*.py;*.html" \ | |
| --recursive \ | |
| --command="./kill.sh" \ | |
| . |
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
| echo ${watch_src_path} | |
| ps awux | grep runserver | grep -v grep | awk '{print $2}' | tail -1 | xargs kill -9; | |
| echo 'killed' | |
| sleep .5 | |
| echo 'reloading' | |
| export PYTHONPATH=/results/svn/TS/dbReports | |
| python manage.py runserver_plus --noreload 0.0.0.0:8000 |
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
| Ld /Users/josh/Library/Developer/Xcode/DerivedData/libPusher-OSX-dzzypffturoukofvlbezlpziwihh/Build/Products/Debug/Pusher.framework/Versions/A/Pusher normal x86_64 | |
| cd /Users/josh/projects/libPusher/libPusher-OSX | |
| setenv MACOSX_DEPLOYMENT_TARGET 10.6 | |
| /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/josh/Library/Developer/Xcode/DerivedData/libPusher-OSX-dzzypffturoukofvlbezlpziwihh/Build/Products/Debug -F/Users/josh/Library/Developer/Xcode/DerivedData/libPusher-OSX-dzzypffturoukofvlbezlpziwihh/Build/Products/Debug -filelist /Users/josh/Library/Developer/Xcode/DerivedData/libPusher-OSX-dzzypffturoukofvlbezlpziwihh/Build/Intermediates/libPusher-OSX.build/Debug/Pusher.build/Objects-normal/x86_64/Pusher.LinkFileList -install_name "@executable_path/../Frameworks/Pusher.framework/Versions/A/Pusher" -mmacosx-version-min=10. |
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 requests | |
| import json | |
| search = "https://jobs.github.com/positions.json?description=python&location=San+Francisco" | |
| attempts = 100 | |
| worked = 0 | |
| for count, attempt in enumerate(xrange(attempts)): | |
| print "Attempt", count, | |
| r = requests.get(search) | |
| if r.json: |
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
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| .country { | |
| fill: #b8b8b8; | |
| stroke: #fff; | |
| stroke-width: .5px; | |
| stroke-linejoin: round; | |
| } |
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 Image | |
| from __future__ import division | |
| import math | |
| import os | |
| """ | |
| This is a bit of Python code that uses PIL to slice very long images into segment sizes of your choice. | |
| For example take a 10,000px tall image, and slice it into 10 10,00px tall images. | |
| thanks to the great docs at http://www.packtpub.com/article/python-image-manipulation |