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
| """ | |
| A process pool that spins up thread pools that spins up asyncio loops. | |
| """ | |
| import asyncio | |
| from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, wait | |
| import random | |
| PROCESS_WORKERS = 2 | |
| THREAD_WORKERS = 2 |
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
| # Inspired by http://liuhongjiang.github.io/hexotech/2015/10/14/alembic-support-multiple-model-files/ | |
| def combine_metadata(): | |
| from sqlalchemy import MetaData | |
| import models # models file into which all models are imported | |
| model_classes = [] | |
| for model_name in models.__all__: | |
| model_classes.append(getattr(models, model_name)) |
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 json | |
| import time | |
| import requests | |
| import pprint | |
| headers = """ | |
| Host: www.ticketmaster.com | |
| Connection: keep-alive | |
| Pragma: no-cache | |
| Cache-Control: no-cache |
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
| """ | |
| This script takes an author link from the Wall Street Journal and producess an RSS feed. | |
| http://topics.wsj.com/person/H/liz-hoffman/7998 | |
| """ | |
| import requests | |
| import bs4 | |
| import re | |
| import datetime | |
| from xml.etree.ElementTree import Element |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <!-- Required meta tags --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| <!-- Bootstrap CSS --> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> |
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
| on run {input} | |
| set the_path to POSIX path of input | |
| set cmd to "vim " & quoted form of the_path | |
| tell application "Terminal" | |
| activate | |
| tell application "System Events" | |
| keystroke "b" using {control down} | |
| delay 0.1 | |
| keystroke "c" | |
| keystroke return |
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
| version: '3.2' | |
| services: | |
| cdb_node_1: | |
| container_name: cdb_node_1 | |
| image: cockroachdb/cockroach:v20.1.3 | |
| volumes: | |
| - cdb_node_1:/cockroach/cockroach-data | |
| command: start --insecure --join=cdb_node_1,cdb_node_2,cdb_node_3 --advertise-addr=cdb_node_1 | |
| ports: |
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
| """ | |
| Back up at https://gist.github.com/logston/088bf6e2435fe8ecac41ab18a93a012a | |
| """ | |
| import base64 | |
| import csv | |
| import getpass | |
| import smtplib | |
| import time | |
| import random | |
| from email.mime.multipart import MIMEMultipart |