Function to print ascii tables out.
wb = Workbook()
wb.country_code = 61
data = [['a','b','c'],[1,2,3],[4,5,6]]
write_sheet(wb, data, "test_sheet", print_to_screen=True) # add one sheet| { | |
| {I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be {much more|a lot more} useful than ever before.| | |
| I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!| | |
| {I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any? {Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe. Thanks.| | |
| {It is|It's} {appropriate|perfect|the best} time to make some plans for the future and {it is|i |
| // 1. Go to page https://www.linkedin.com/settings/email-frequency | |
| // 2. You may need to login | |
| // 3. Open JS console | |
| // ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)) | |
| // 4. Copy the following code in and execute | |
| // 5. No more emails | |
| // | |
| // Bookmarklet version: | |
| // http://chengyin.github.io/linkedin-unsubscribed/ |
| #!/usr/bin/env python | |
| import os | |
| import pip | |
| dists = [] | |
| for dist in pip.get_installed_distributions(): | |
| dists.append(dist.project_name) | |
| for dist_name in sorted(dists, key=lambda s: s.lower()): |
| """ | |
| S3 Uploader for Python 3 | |
| Colton J. Provias | |
| Usage: | |
| f = open('sample.png', 'rb') | |
| contents = f.read() | |
| response, url = upload_to_s3('AWSKEY', 'AWSSECRET', 'mybucket', 'image.png', contents, 'image/png') | |
| """ |
| CREATE AGGREGATE array_accum (anyarray) | |
| ( | |
| sfunc = array_cat, | |
| stype = anyarray, | |
| initcond = '{}' | |
| ); |
| from cProfile import Profile | |
| from django.core.management.base import BaseCommand | |
| class ProfileEnabledBaseCommand(BaseCommand): | |
| """Enable profiling a command with --profile. | |
| Requires child class to define _handle instead of handle. | |
| via https://gist.github.com/dfrankow | |
| """ |
| CREATE OR REPLACE FUNCTION hstore_merge(left HSTORE, right HSTORE) RETURNS HSTORE AS $$ | |
| SELECT $1 || $2; | |
| $$ LANGUAGE SQL; | |
| CREATE AGGREGATE hstore_merge (HSTORE) ( | |
| SFUNC = hstore_merge, | |
| STYPE = HSTORE, | |
| INITCOND = '' | |
| ); |
Function to print ascii tables out.
wb = Workbook()
wb.country_code = 61
data = [['a','b','c'],[1,2,3],[4,5,6]]
write_sheet(wb, data, "test_sheet", print_to_screen=True) # add one sheet| {% load crispy_forms_field %} | |
| <div id="div_{{ field.auto_id }}" class="control-group{% if form_show_errors and field.errors %} error{% endif %} {% if field.field.widget.attrs.class %} {{ field.field.widget.attrs.class }}{% endif %}"> | |
| {% if field.label %} | |
| <label for="{{ field.id_for_label }}" class="control-label {% if field.field.required %}requiredField{% endif %}"> | |
| {{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | |
| </label> | |
| {% endif %} |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!