This file contains hidden or 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
| [ | |
| { | |
| "emails": [ | |
| { | |
| "bcc": [], | |
| "cc": [], | |
| "date": "2013-04-03T20:46:12", | |
| "sender": { | |
| "address": "[email protected]", | |
| "name": "Gmail Team" |
This file contains hidden or 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
| omgmail=# \d mail_email | |
| Table "public.mail_email" | |
| Column | Type | Modifiers | |
| ---------------------+--------------------------+----------- | |
| id | uuid | not null | |
| account_id | integer | not null | |
| last_update | timestamp with time zone | not null | |
| uid | bigint | | |
| gm_msg_id | bigint | not null | |
| thread_id | bigint | not null |
This file contains hidden or 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
| QUERY PLAN | |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| Limit (cost=471953.26..471953.38 rows=50 width=77) (actual time=2523.902..2524.063 rows=50 loops=1) | |
| -> Sort (cost=471953.26..472037.42 rows=33664 width=77) (actual time=2523.898..2523.952 rows=50 loops=1) | |
| Sort Key: (max(date)) | |
| Sort Method: top-N heapsort Memory: 36kB | |
| -> GroupAggregate (cost=461030.36..470834.96 rows=33664 width=77) (actual time=2230.769..2520.320 rows=1681 loops=1) | |
| Filter: bool_or(is_inbox) | |
| -> Sort (cost=461030.36..461616.85 rows=234595 width=77) (actual time=1158.555..1430.159 rows=215157 loops=1) | |
| Sort Key: thread_id |
This file contains hidden or 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
| @login_required | |
| def linked_in(request): | |
| REDIRECT_URI = 'http://127.0.0.1:8000/linkedin' | |
| if 'clear' in request.GET: | |
| del request.session['linkedin'] | |
| print "clear." | |
| elif not 'linkedin' in request.session: | |
| request.session['person'] = request.GET.get('person') | |
| request.session['linkedin'] = 'authing' | |
| params = urllib.urlencode({ |
This file contains hidden or 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 re | |
| import string | |
| # find the first quote in a string | |
| quotere = re.compile( | |
| r"""(?P<quote>"[^\"\\]*(?:\\"|[^"])*") # Quote, possibly containing encoded | |
| # quotation mark | |
| \s*(?P<rest>.*)$ """, | |
| re.VERBOSE) |
This file contains hidden or 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 os,glob; print os.path.join('.', 'path/to/file') in sum([[f[0] for f in [glob.glob(os.path.join(d[0], pattern)) for d in os.walk('.')] if f] for pattern in open('.gitignore', 'r+').read().split('\n')], [])" |
This file contains hidden or 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 httplib, base64 | |
| host = "server.com" | |
| path = "/foo/bar" | |
| username = "jess" | |
| password = "hunter2" | |
| http = httplib.HTTP(host) | |
| http.putrequest("GET", path) |
This file contains hidden or 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
| from mock import Mock, patch | |
| import requests | |
| class VSSecureMailWS: | |
| def encrypt_and_send(self, url, data): | |
| r = requests.post(url) | |
| if r.status_code == 200: | |
| return "{0} {1}".format(data, r.text) | |
| else: | |
| return "Error" |
This file contains hidden or 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 heaviest_incr_subseq(seq, weights): | |
| dp = {} | |
| dp[0] = weights[0] | |
| for i in xrange(1, len(seq)): | |
| dp[i] = weights[i] | |
| for j in reversed(xrange(0, i - 1)): | |
| if (dp[j] + weights[i] > dp[i]): | |
| dp[i] = dp[j] + weights[i] | |
| return max(dp.values()) |
This file contains hidden or 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
| “Turning Geo-Data into Geo-Visualizations” | |
| When tasked with displaying geo-data, most developers decide to put some big red markers on an embeddable Google Map and call it a day. If want to create maps that are more beautiful, more interactive, and more usable, this session is for you. | |
| Abstract: | |
| This session is an introduction to the tools available for creating beautiful, interactive geo-visualizations for the web. | |
| New tools and libraries have lowered the barrier of entry for creating useful maps. What was once exclusively the realm of traditional geographers is now accessible by almost any web developer. |