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 | |
# Crontab setting to bother you during wokring hours on weekdays | |
# 0 9,10,11,12,13,14,15,16 * * 1,2,3,4,5 /usr/local/bin/exercise_helper.py | |
from random import choice, randrange | |
from datetime import date | |
from math import ceil | |
import tkMessageBox |
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
select product, url from ( | |
select row_number() over (partition by vendor order by product desc) as r, t.* from | |
(select vendor.name as vendor, product.name as product, coalesce(shelf.detail_url,shelf.buy_url, null) as url from shelf | |
join product on product.id = shelf.product_id | |
join vendor on vendor.id = shelf.vendor_id) as t) as x | |
where x.r <= 10 |
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 _djdt_check(request): | |
# Don't show the DJDTB in the admin. | |
if request.path.startswith("/admin/"): | |
return False | |
return True | |
DEBUG_TOOLBAR_CONFIG = { | |
'INTERCEPT_REDIRECTS': False, | |
'SHOW_TOOLBAR_CALLBACK': _djdt_check | |
} |
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
// Implementation of the router pattern using function.length | |
var add_two_things = function(a, b) { | |
return a + b | |
} | |
var add_three_things = function(a, b, c) { | |
return a + b + c | |
} | |
var get_router = function() { |