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
#title credit serviceUrl yOriginTop zmin zmax xmin ymin xmax ymax | |
Mapbox © OpenStreetMap contributors http://api.tiles.mapbox.com/v4/sirleech.map-izvflxu8/{z}/{x}/{y}.png?access_token=[yourkey] 1 0 19 | |
OpenStreetMap © OpenStreetMap contributors http://a.tile.openstreetmap.org/{z}/{x}/{y}.png 1 0 19 | |
Mapquest sat http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg 1 0 19 | |
Mapquest streets http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg |
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
auto lo | |
# assign static IP 192.168.1.55 | |
# gateway = your router IP | |
iface lo inet loopback | |
iface eth0 inet static | |
address 192.168.1.55 | |
netmask 255.255.255.0 | |
gateway 192.168.1.254 |
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/bash | |
# install on AMI Sydney Ubuntu 12.04 lTS | |
# ami-4cf26376 | |
# ap-southeast-2 precise 12.04 LTS amd64 ebs 20130222 ami-4cf26376 | |
# https://console.aws.amazon.com/ec2/home?region=ap-southeast-2#launchAmi=ami-4cf26376 | |
# run as user 'ubuntu' | |
# bash <(curl -s http://mywebsite.com/myscript.txt) | |
sudo apt-get -q -y update | |
sudo apt-get -q -y upgrade |
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
syntax on | |
filetype indent plugin on |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
WSGIScriptAlias / /var/www/webpy-app/code.py/ | |
Alias /appname/static /var/www/webpy-app/static/ | |
AddType text/html .py | |
<Directory /var/www/webpy-app/> | |
Order deny,allow |
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 web | |
import json | |
urls = ( | |
'/', 'index', | |
'/random', 'random', | |
'/dump', 'dump' | |
) |
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 | |
print "Content-type:application/json" | |
print "Access-Control-Allow-Origin: *\r\n\r\n" | |
import random | |
import sys | |
import datetime | |
now = datetime.datetime.now() |
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
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
<style> | |
body {font-size: 200%;} | |
.hidden {display:none;} | |
</style> | |
</head> | |
<body> | |
Random: <div id="randomNumber">RAND</div> |
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
<?php | |
function putToCosm($csv){ | |
echo 'logging to cosm...'; | |
$url = 'http://api.cosm.com/v2/feeds/YOURFEEDID.csv'; | |
$ch = curl_init($url); | |
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
Install Homebrew: | |
http://mxcl.github.com/homebrew/ | |
http://blog.teamtreehouse.com/installing-ruby-rails-and-mysql-on-os-x-lion | |
To solve mysql problems: | |
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html |
NewerOlder