ESPN's hidden API endpoints
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
In your command-line run the following commands:
brew doctorbrew update| // Original author fwed (contact@fwed.fr) | |
| // Modified from | |
| // https://gist.github.com/anonymous/2cca33d376f7f924fdaa67891ad098cc | |
| // https://medium.com/@fw3d/auto-archive-emails-in-gmail-after-2-days-1ebf0e076b1c | |
| function gmailAutoArchive() { | |
| gmailAutoarchiveHelper(1); | |
| gmailAutoarchiveHelper(2); | |
| gmailAutoarchiveHelper(3); | |
| gmailAutoarchiveHelper(7); |
| #!/usr/bin/env bash | |
| # https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
| # https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
| # https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
| # https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
| # https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
| # https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
| # Versions | |
| CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE` |
| #!/usr/bin/env python | |
| """ | |
| Warm the caches of your website by crawling each page defined in sitemap.xml. | |
| To use, download this file and make it executable. Then run: | |
| ./cache-warmer.py --threads 4 --file /data/web/public/sitemap.xml -v | |
| """ | |
| import argparse | |
| import multiprocessing.pool as mpool | |
| import os.path | |
| import re |
I ran into an issue today where I had to perform a bulk insert into a postgres DB. I was already using SQLAlchemy and Flask-SQLAlchemy to manage the connections to the db and I didn't want to have to use things like psycopg2 directly.
Note: SQLAlchemy provides an ORM. It isn't just an ORM. That is an important thing to be kept in mind. This means that you can bypass choose to not use the ORM layer when you don't want it. The idea with an ORM is to track changes to objects and when you have a case like that is when you'd use the ORM. In a bulk upload scenario, you don't need to track changes to objects. All you care is that everything be pushed into the DB.
| def upsert(db_cur, table, pk_fields, schema=None, **kwargs): | |
| """Updates the specified relation with the key-value pairs in kwargs if a | |
| row matching the primary key value(s) already exists. Otherwise, a new row | |
| is inserted. Returns True if a new row was inserted. | |
| schema the schema to use, if any (not sanitized) | |
| table the table to use (not sanitized) | |
| pk_fields tuple of field names which are part of the primary key | |
| kwargs all key-value pairs which should be set in the row | |
| """ |