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
# Use Homebrew to install drush | |
$ brew install drush | |
# Mysql Command Line and PHP to .bash_profile | |
export PATH=/Applications/MAMP/bin/php/php5.3.6/bin:$PATH | |
$ sudo mkdir /var/mysql | |
$ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock |
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
echo "pointer = 1 2 3 5 4 7 6 8 9 10 11 12" > ~/.Xmodmap && xmodmap ~/.Xmodmap |
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 | |
import urllib2 | |
import json | |
import string | |
jsonfile = open('single-geojson-sample.json', 'r') | |
entry = jsonfile.readlines() | |
req = urllib2.Request('http://localhost:8983/solr/omar/update/json?commit=true') |
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
[{ "id": 101, | |
"coordinates": "POLYGON (( 100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0 ))" | |
}] |
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
""" | |
An example of using doctest to automatically test. | |
One function that adds items together. | |
>>> adder(1,2) | |
3 | |
""" | |
def adder(x,y): |
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 unittest | |
# Here's our "unit". | |
def IsOdd(n): | |
return n % 2 == 1 | |
def IsaString(text): | |
#text = "Hello" | |
text = ['apples', 'bananas'] | |
return type(text) |
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
Vagrant::Config.run do |config| | |
config.vm.box = "bensprecise64" | |
config.vm.network :hostonly, "192.168.33.19" | |
## Use all the defaults: | |
config.vm.provision :salt do |salt| | |
salt.run_highstate = true | |
## Optional Settings: | |
salt.minion_config = "salt/minion.conf" |
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 flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route("/") | |
def index(): | |
return "Hello World!" | |
@app.route('/hello/') | |
@app.route('/hello/<name>') | |
def hello(name=None): |
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 bottle import route, run, static_file, request, abort, redirect, view, template | |
import re | |
# Serve a static html with templates | |
# Create an index.tpl and save it in /views | |
''' | |
#Sample index.tpl | |
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="/static/styles.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
import os | |
from bottle import Bottle, route, run | |
application = app = Bottle() | |
@app.route('/') | |
def index(name=['hello', 'World', 'from <a href="http://appfog.com">Appfog!</a>']): | |
return '<br>'.join(name) | |