Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View geoffalday's full-sized avatar

Geoff Alday geoffalday

View GitHub Profile
@geoffalday
geoffalday / secretkey.py
Created March 12, 2012 12:28
How to generate a secret key with Python
# How to generate a secret key with Python
# via http://flask.pocoo.org/docs/quickstart/
import os
os.urandom(24)
@geoffalday
geoffalday / unity-git-lfs-instructions.md
Last active June 25, 2023 19:08
Setting up Unity for Git LFS
@geoffalday
geoffalday / index.py
Created March 6, 2012 13:19
Getting a Python/Flask app running on Webfaction
# Follow instructions here: http://flask.pocoo.org/snippets/65/
# You'll need to make sure you have the right Python version and any packages installed: http://docs.webfaction.com/software/python.html
# This tweak to index.py is what made it actually work: http://stackoverflow.com/questions/3696606/how-to-solve-import-errors-while-trying-to-deploy-flask-using-wsgi-on-apache2
import sys
yourappname = "/home/username/webapps/yourappname/htdocs"
if not yourappname in sys.path:
sys.path.insert(0, yourappname)
from yourappname import app as application
@geoffalday
geoffalday / get-weather-data.py
Created June 15, 2012 16:31
Scrape weather data
import urllib2
from bs4 import BeautifulSoup
# What year?
year = 2011
# Create/open a file called wunder.txt
f = open('wunder-data-' + str(year) + '.txt', 'w')
f.write('datestamp,tmean,tmax,tmin,precip,dewpoint\n')
@geoffalday
geoffalday / gist:5105602
Last active December 14, 2015 15:08
Car Monitor + Raspberry Pi settings
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
overscan_left=22
overscan_right=38
overscan_top=-22
overscan_bottom=-24
@geoffalday
geoffalday / gist:4731700
Last active December 12, 2015 06:49
Setting the color of button text to black in CSS vs. Objective-C.
.button { color: black; }
@geoffalday
geoffalday / gist:4189584
Created December 2, 2012 16:24 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@geoffalday
geoffalday / index.html
Created November 14, 2012 16:37
A CodePen by Geoff Alday. - All graphical elements created with CSS.
<div class="box">
<div class="box-top"></div>
<div class="box-body">
<div class="heading">
<h1>Introduction</h1>
</div>
<div class="content">
<p>The passion for play is probably as old, and will be as enduring, as the race of man. Some of us are too timid to risk a dollar, but the percentage of people in this feverish nation who would not enjoy winning one is very small. The passion culminates in the professional. He would rather play than eat. Winning is not his sole delight. Some one has remarked that there is but one pleasure in life greater than winning, that is, in making the hazard.</p>
</div>
</div>
@geoffalday
geoffalday / nashville-weather-1981.r
Created June 21, 2012 12:32
Display a year's weather using R
#Nashville Weather in 1981
weather1981 <- read.csv('wunder-data-1981.txt', sep=',', header=TRUE)
high_colors <- c()
for (i in 1:length(weather1981$tmax)) {
if (weather1981$tmax[i] > 80) {
high_colors <- c(high_colors, '#CC0000')
} else {
high_colors <- c(high_colors, '#9ACC78')
@geoffalday
geoffalday / weather.r
Created June 15, 2012 15:58
Displays hottest days using R
# Nashville's hottest days in 2011
weather2011 <- read.csv('wunder-data-2011.txt', sep=',', header=TRUE)
fill_colors <- c()
for (i in 1:length(weather2011$tmax)) {
if (weather2011$tmax[i] > 80) {
fill_colors <- c(fill_colors, '#CC0000')
} else {
fill_colors <- c(fill_colors, '#CCCCCC')