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
| # stores is a giant list of strings of addresses comma separated | |
| b = [[x.strip() for x in a.split(',')[0].split(' ')+a.split(',')[1:]] for a in stores]; | |
| f = open('/tmp/stores.txt', 'w'); | |
| [f.write(','.join(map(lambda x: '"'+x+'"', y))+"\n") for y in b]; | |
| f.close() | |
| #tada! |
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
| #!/usr/bin/env python2 | |
| import urllib2 | |
| import sys | |
| from BeautifulSoup import BeautifulSoup | |
| # Until there is an actual API for VMG we've had to use something like this | |
| # which will return the totals for a list of users from the command line. | |
| # It's not too much to imagine this saving the things to a db and running | |
| # periodically via a cron job. |
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
| #!/usr/bin/env python2 | |
| import os | |
| import sys | |
| # Setup a working environment for our vans app | |
| PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../')) | |
| sys.path.append(PROJECT_PATH) | |
| os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' | |
| # Import our sites and models we need |
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
| #!/usr/bin/env python2 | |
| import os | |
| import sys | |
| import paramiko | |
| import zipfile | |
| local_file = sys.argv[1] | |
| KNOWN_HOSTS = os.path.join(os.getenv("HOME"), '.ssh', 'known_hosts') |
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
| #!/usr/bin/env python2 | |
| # Use BSoup to read through a given url, pull out the links and then write them | |
| # to a file for use by siege for HTTP load testing. You can filter with a given | |
| # class name and prepend a base url for those without http parts. | |
| # Usage: | |
| # | |
| # createSiegeUrls http://127.0.0.1/site/ | |
| import urllib |
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
| function activate { | |
| export PYTHONPATH=/home/jaymz/development/virtualenvs/$1/lib/python2.7/site-packages/; | |
| source /home/jaymz/development/virtualenvs/$1/bin/activate; | |
| } |
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
| <script type="text/javascript"> | |
| /* Can't remember where I saw this but it's quite handy/cool for tables to do filtering without posts */ | |
| $(document).ready(function(){ | |
| //add index column with all content. | |
| $(".filterable tr:has(td)").each(function(){ | |
| var t = $(this).text().toLowerCase(); //all row text | |
| $("<td class='indexColumn'></td>") | |
| .hide().text(t).appendTo(this); | |
| });//each tr | |
| $("#FilterTextBox").keyup(function(){ |
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
| <script type="text/javascript"> | |
| var _gaq = _gaq || []; | |
| _gaq.push(['_setAccount', 'UA-3092654-28']); | |
| _gaq.push(['_trackPageview']); | |
| (function() { | |
| var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
| ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
| var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
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
| CREATE TABLE `blogger_bloggerpost` ( | |
| `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, | |
| `blog_id` integer NOT NULL, | |
| `post_id` varchar(255) NOT NULL UNIQUE, | |
| `published` datetime NOT NULL, | |
| `updated` datetime NOT NULL, | |
| `title` varchar(255), | |
| `content` longtext NOT NULL, | |
| `content_type` varchar(100) NOT NULL, | |
| `link_edit` varchar(200), |
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
| <html> | |
| <head> | |
| <title>Jaymz Facebook friend JSON click test thing</title> | |
| <link href='http://fonts.googleapis.com/css?family=Maven+Pro' rel='stylesheet' type='text/css'> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> | |
| <style> | |
| body { | |
| margin:20px auto; | |
| font-family: 'Maven Pro', arial, serif; | |
| } |