Skip to content

Instantly share code, notes, and snippets.

View MasterOdin's full-sized avatar

Matthew Peveler MasterOdin

View GitHub Profile
@MasterOdin
MasterOdin / python_qr
Created August 4, 2014 23:19
Python QRServer API Script
import requests
import urllib
from PIL import Image
from StringIO import StringIO
base = "http://forums.somethingawful.com/showthread.php?"
base = base + "threadid=3571852&pagenumber=204#lastpost"
url = urllib.quote(base)
r = requests.get("http://api.qrserver.com/v1/create-qr-code/?data=" + url + "&size=200x200")
print r.status_code
@MasterOdin
MasterOdin / pig_latin.py
Last active August 29, 2015 14:01
Turns a phrase into pig latin following the rules described on https://en.wikipedia.org/wiki/Pig_Latin
# simple check for if something is a "vowel"
def isVowel(letter):
return letter in ["a","e","i","o","u","y"]
# only phrases that contain only alpha characters is accepted
valid = False
while not valid:
phrase = raw_input("Enter a phrase ==> ")
valid = phrase.replace(" ","").isalpha()

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/