Skip to content

Instantly share code, notes, and snippets.

View danieljnowak's full-sized avatar

Daniel Nowak danieljnowak

View GitHub Profile
@danieljnowak
danieljnowak / sql issue
Created September 6, 2012 21:52
Nested Query
I am perform a query based on the results of another query. I need to take the primary key of one table and match it on anothe column of the same table. I need to associate the description with the movie.
I have tried
SELECT movie.id movie.title scene.id from scene, movie where movie.id = scene.movie_id
Now I need to know how to take that data and requery the same table to get the scene description to be associated with the movie they belong too
Movie Table
+---+----------------+
@danieljnowak
danieljnowak / gist:3702344
Created September 11, 2012 21:49
Pyramid Buildout
[buildout]
parts =
pyramid
bootstrap
extensions += mr.developer
include-site-packages = false
eggs =
@danieljnowak
danieljnowak / htaccess Allow robots.txt restrict by ip.txt
Created November 15, 2012 20:20
Here is an htaccess files that will allow your robots.txt file to be seen but will restrict the rest of the website by ip address.
<Files robot.txt>
Order deny,allow
Allow from all
</Files>
Order deny,allow
deny from all
allow from 8.8.8.8
@danieljnowak
danieljnowak / test_checkin.py
Created January 26, 2013 23:37
Untiltess from pyclass
import sleepin
import unittest
class TestSleepIn(unittest.TestCase):
def test_valid_weekday(self):
self.assertFalse(sleepin.sleep_in('09-02-2013'),
"09-02-2013 is a Thursday")
def test_valid_weekend(self):
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 12 columns, instead of 8 in line 8.
Name,hash,DOB,date2,date3,mothers maiden,Spouse,first love,child1,child2,pet1,pet2
Eva Rivera,2344521e389d6897ae7af9abf16e7ccc,8/7/1960,3/29/1963,6/13/1971,Watson,Bella,Julia,Luis,Naomi,Bailey,Duke
Aaron Moore,034c3269e6c5cae4f3115c07234e3fd9,7/26/1979,5/24/1953,6/26/1980,Gonzalez,Thomas,Naomi,Jocelyn,Sebastian,Casey,Sammy
Lillian Hughes,e10adc3949ba59abbe56e057f20f883e,11/11/1997,6/15/1969,4/11/1961,Hughes,Eli,Grace,Julia,Hannah,Lucy,Buster
Ava Cox,0c9505d8417a18f29725eec045435c60,8/18/1973,9/14/1973,5/13/1987,Roberts,Caroline,Anna,Hunter,Adam,Belle,Sam
Allison Parker,bd3701331c330be17b96cd307f85fb6e,5/5/1994,11/6/1967,4/29/1999,Williams,Chloe,Luis,Jackson,Thomas,Louie,Ginger
Parker Davis,5f4dcc3b5aa765d61d8327deb882cf99,8/27/1969,11/1/1989,4/18/1991,Wright,Joshua,Elijah,Gianna,Blake,Bandit,Belle
Thomas Stewart,3bf883287537958205ba77aca556583d,8/18/1952,1/8/1998,12/4/1991,Garcia,Carter,Aaron,Alyssa,Julian,Missy,Murphy
Adrian Wood,21da087a3a7b3ce8c9b63c5ca74670a5,4/22/1981,1/19/1988,10/16/1999,James,Molly,Lui