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
# we should be running psql in dev since heroku does. | |
default: &DEFAULT | |
adapter: postgresql | |
encoding: utf8 | |
min_messages: warning | |
development: | |
<<: *DEFAULT | |
database: tedx_dev | |
test: | |
<<: *DEFAULT |
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
# Returns sorted array of types of items that there are changes for. | |
def change_item_types | |
return ActiveRecord::Base.connection.select_values('SELECT DISTINCT(item_type) FROM versions ORDER BY LOWER(item_type)') | |
end |
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
19:17 admin@meatball: ~/.kegbot | |
> pip install PIL | |
Downloading/unpacking PIL | |
Downloading PIL-1.1.7.tar.gz (506Kb): 506Kb downloaded | |
Running setup.py egg_info for package PIL | |
Installing collected packages: PIL | |
Running setup.py install for PIL | |
--- using frameworks at /System/Library/Frameworks | |
building '_imaging' extension | |
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.6/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _imaging.c -o build/temp.macosx-10.6-universal-2.6/_imaging.o |
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
> python -c 'import sys; print "\n".join(["%s %s" % (i, v) for i, v in enumerate(sys.path)])' | |
0 | |
1 /Library/Python/2.6/site-packages/pip-1.0.1-py2.6.egg | |
2 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip | |
3 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 | |
4 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin | |
5 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac | |
6 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages | |
7 /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python | |
8 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk |
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
19:14 admin@meatball: ~/.kegbot [1] | |
> kegbot-admin.py runserver | |
Validating models... | |
Unhandled exception in thread started by <bound method Command.inner_run of <django.core.management.commands.runserver.Command object at 0x10110b550>> | |
Traceback (most recent call last): | |
File "/Library/Python/2.6/site-packages/django/core/management/commands/runserver.py", line 88, in inner_run | |
self.validate(display_num_errors=True) | |
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 249, in validate | |
num_errors = get_validation_errors(s, app) |
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
{ | |
"address1":"Love Park", | |
"address2":"", | |
"byob":false, | |
"cash_only":false, | |
"city":"Philadelphia", | |
"debug": | |
[ | |
], |
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
class Location | |
include MongoMapper::Document | |
scope :restaurants, where(:loc_type => 'restaurant') | |
scope :bars, where(:loc_type => 'bar') | |
scope :trucks, where(:loc_type => 'truck') | |
key :name, String, :required => true | |
key :store_no, Integer | |
key :address1, String |
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
def self.coordinates(addr) | |
include Geokit::Geocoders | |
res=MultiGeocoder.geocode(addr) | |
r = res.ll.split(',') | |
[r[0].to_f, r[1].to_f] | |
end | |
def self.create(params = nil) | |
loc = coordinates(params[:address1] + "+PA+" + params[:zipcode]) | |
super |
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
require 'csv' | |
def coordinates(addr) | |
include Geokit::Geocoders | |
res=MultiGeocoder.geocode(addr) | |
res.ll | |
end | |
namespace :import do | |
desc 'Parse CSV files and import into the database' |
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
[alias] | |
co = checkout | |
ci = commit | |
st = status | |
pu = push | |
pl = pull | |
pub = "!f() { git push ${1:-origin} `git symbolic-ref HEAD`; }; f" | |
[user] | |
email = [email protected] | |
name = Linus Graybill |