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
''' | |
given a Model with: | |
category = models.CharField(max_length=32, choices=CATEGORY_CHOICES) | |
pubdate = models.DateTimeField(default=datetime.now) | |
<other fields> | |
Fetch the item from each category with the latest pubdate. | |
''' |
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
War On Christmas | |
Glow | |
Cambian | |
Somnambulance | |
Long March | |
Seperate But Equal | |
Peterson | |
Thompson | |
Twelve Days Awake | |
Everyone Gets Shot |
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
Five recurring, automatic patterns of thought (aka cognitive distortions) among people who get extraordinary stuff done in Silicon Valley. | |
1. Personal Exceptionalism: "I am special." | |
Definition: a macro sense that you are in the top of your cohort, your work is snowflake special, or that you are destined to have experiences well outside the bounds of "normal;" not to be confused with arrogance or high self-esteem | |
Benefit: resilience, stamina, charisma | |
Deadly risk: assuming macro exceptionalism means micro exceptionalism, brittleness |
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
/* | |
* Modified Lorem Ipsum Generator by Fredrik Bridell (http://bridell.com/loremipsum/)" | |
* | |
* To use: download the .js file, and in your html include the markup: | |
* <script type="text/javascript" src="loremipsum.js"></script> | |
* | |
* Where you want the Lorem Ipsum, include something like: | |
* <script type="text/javascript">loremIpsumParagraph(100)</script> | |
*/ |
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
#!/bin/bash | |
# bash_prompt | |
# Example: | |
# nicolas@host: ~/.dotfiles on master[+!?$] | |
# $ | |
# Screenshot: http://i.imgur.com/DSJ1G.png | |
# iTerm2 prefs: import Solarized theme (disable bright colors for bold text) |
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
# Sources: | |
# http://mcdc2.missouri.edu/pub/data/sf32000/Techdoc/ch4_summary_level_seq_chart.pdf | |
# http://www2.census.gov/acs2011_1yr/summaryfile/ACS_2011_SF_Tech_Doc.pdf | |
SUMMARY_LEVEL_DICT = { | |
"010","United States", | |
"020","Region", | |
"030","Division", | |
"040","State", | |
"050","State-County", | |
"060","State-County-County Subdivision", |
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
import requests | |
import bs4 | |
import csv | |
URL = 'http://www.dllr.state.md.us/employment/warn.shtml' | |
warn_page = requests.get(URL) | |
soup = bs4.BeautifulSoup(warn_page.text, 'html.parser') | |
table = soup.find('table') | |
rows = table.find_all('tr') |
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
import csv | |
from collections import OrderedDict | |
CLEANED_DICT = OrderedDict() | |
METADATA_FIELDS = ['districtID','district','schoolID','school'] | |
VALUE_FIELDS = [] | |
with open('schools.csv') as csvfile: | |
reader = csv.DictReader(csvfile) | |
for row in reader: |
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
bible_objects = ['seed', 'gold', 'resin', 'onyx', 'fruit', 'fig leaves', 'fruit', 'vegetables', 'portion of meat', 'ark', 'olive leaf', 'burnt offerings', 'wine', 'bricks', 'silver', 'gold', 'tents', 'bread', 'wine', 'heifer carcass', 'goat carcass', 'ram carcass', 'brazier', 'torch', 'flour', 'curds', 'milk', 'veal', 'bread', 'one thousand silver shekels', 'food', 'skin of water', 'wood', 'knife', 'burnt offering', 'four hundred silver shekels', 'jar', 'gold nose ring', 'gold bracelets', 'straw', 'fodder', 'gold and silver jewellery', 'clothing', 'bread', 'lentil stew', 'quiver', 'bow', 'clothes', 'goatskins', 'bread', 'food', 'wine', 'stone', 'oil', 'mandrake plants', 'poplar branches', 'almond branches', 'watering troughs', 'tent', 'gods', 'saddle', 'stone', 'stones', 'food', 'one hundred pieces of silver', 'tent', 'altar', 'idols', 'earring', 'stone', 'oil', 'ornamented robe', 'food', 'spices', 'balm', 'myrrh', 'twenty shekels', 'clothes', 'goat carcass', 'sackcloth', 'clothes', 'veil', 'seal', 'cord', 's |
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
// hit the /parents API endpoint | |
$.getJSON(parentGeoAPI) | |
.done(function(results) { | |
var parents = results['parents']; | |
// list of unique parent sumlev types, maintaining order | |
var parentRelations = _.uniq(_.pluck(parents, 'sumlevel')); | |
// collect parents into individual sumlev groups | |
var parentGroups = _.groupBy(parents, function(d) { | |
return d.sumlevel; | |
}); |
NewerOlder