The update_or_create
model function was updated in Django 5.0 with a create_defaults
argument that allows only used during create operations.
> time go run cryptocoinmarketcap.go
2017/12/19 17:26:38 Scraping finished, check file "cryptocoinmarketcap-go.csv" for results
2.24 real 0.84 user 0.45 sys
> time python3 cryptocoinmarketcap.py
WARNING:root:Scraping finished, check file cryptocoinmarketcap-py.csv for results
3.51 real 2.94 user 0.07 sys
I hereby claim:
- I am myles on github.
- I am myles (https://keybase.io/myles) on keybase.
- I have a public key ASDdUR3w8haibPH-nGAJrwbnYONKwSQVACkpDwI1wM7qrAo
To claim this, I am signing this object:
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 | |
""" | |
A simple script that creates an OPML file of the RSS feeds to | |
a Twitter user's lists. | |
python twitter_list_to_opml.py mylesb | |
Copyright (c) 2010, Myles Braithwaite <me@mylesbraithwaite.com> | |
All rights reserved. |
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 | |
""" | |
A simple script that extracts transcripts from <http://www.ted.com> | |
HOWTO: | |
python ted_tracscript_extractor.py john_hodgman_s_brief_digression.html | |
or | |
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 | |
import vobject | |
import datetime | |
from pytz import timezone | |
from dateutil import rrule | |
TIME_ZONE = timezone('US/Eastern') | |
TODAY = datetime.date.today() - datetime.timedelta(days=31) | |
MEETING_START_TIME = datetime.time(19, 30, tzinfo=TIME_ZONE) |
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 python3 | |
import subprocess | |
def osascript(script): | |
""" | |
This is a bridge between Python and AppleScript using the `osascript` | |
comamnd line app. | |
""" |
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 json | |
from django.utils.feedgenerator import SyndicationFeed, rfc2822_date | |
class JSONFeed(SyndicationFeed): | |
mime_type = 'application/json; charset=utf-8' | |
def write(self, outfile, encoding): | |
data = {} |
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
for pptx in *.pptx; | |
do | |
libreoffice --headless --convert-to pdf $pptx | |
convert -density 400 `basename $pptx`.pdf -resize 2000x1500 `basename $pptx`%d.jpg | |
rm `basename $pptx`.pdf | |
done |
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 python3 | |
import argparse | |
import math | |
import os.path | |
import pandas as pd | |
import numpy as np | |
def main(filepath): |
NewerOlder