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 | |
import logging | |
import math | |
from contextlib import contextmanager | |
from django.core.management import call_command | |
from django.core.management.base import CommandError | |
from django.db import transaction | |
from morango.models import Filter | |
from morango.models import InstanceIDModel |
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
The Hangout on Air is not yet active. Please try again after 8am on Monday. |
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 datetime | |
import random | |
import time | |
from multiprocessing import Lock | |
from notion.client import * | |
from notion.block import * | |
mutex = Lock() |
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 smpplib2.gsm | |
import smpplib2.client | |
import smpplib2.consts | |
import smpplib2.exceptions | |
# TODO: update these based on the address/credentials for the SCSM server | |
SMSC_ADDRESS = '127.0.0.1' | |
SMSC_PORT = 1234 | |
SMSC_SYSTEM_ID = 'pavel' | |
SMSC_PASSWORD = 'wpsd' |
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 requests | |
import tempfile | |
from bs4 import BeautifulSoup | |
from ricecooker.classes.nodes import ChannelNode, HTML5AppNode, TopicNode | |
from ricecooker.classes.files import HTMLZipFile, ThumbnailFile | |
from ricecooker.utils.caching import CacheForeverHeuristic, FileCache, CacheControlAdapter, InvalidatingCacheControlAdapter | |
from ricecooker.utils.html import download_file | |
from ricecooker.utils.zip import create_predictable_zip |
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 time | |
from django.template import Template, Context | |
from django.conf import settings | |
settings.configure() | |
source = """<p>Hello, my name is {{name}}. I am from {{hometown}}. I have {{kids|length}} kids:</p> | |
<ul>{% for kid in kids %}<li>{{kid.name}} is {{kid.age}}</li>{% endfor %}</ul>""" |
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
old_vids = set(["C-2Ln0pK3kY", "01c12NaUQDw", "ZD8THEz18gc", "5lmHzAHbtzg", "qVPtT8CX1eM", "ER49EweKwW8", "gzm-uhj06q8", "EA0LkCkvUeU", "TEfyIsDRGCk", "1C4ETKeTMq8", "LXi5FUMNTjE", "GW8ZPjGlk24", "_NWc3C3cTNA", "vAW9t5uBr08", "EvvxBdNIUeQ", "hGMwMlksZlM", "8GhjZn2W8ns", "-FtlH4svqx4", "ouAFk0Jy6TY", "Qp87Z4m8R-w", "wBCowBiXV7A", "MNUVuZu6heA", "HwSszh3L358", "W2NnNKtquaE", "P6PEf9WtEvs", "0CIn1_M-BoY", "nLY2bzRfQyo", "RouNXdkC0do", "KRFiAlo7t1E", "3cVSSiuiwsQ", "lOIP_Z_-0Hs", "CDvPPsB3nEM", "TErJ-Yr67BI", "M_ADc9jkBig", "TbaltFbJ3wE", "H5w55UbIZTw", "uqyLOuAzbvo", "-sA-vI2a2mM", "N06Jy-gQog8", "VrflZifKIuw", "z45UEiPaE8c", "QkepM8Vv3kw", "Sc6zc8KR_NU", "a-e8fzqv3CE", "I8BLj7cRM7c", "47JRs6hF_ic", "cTveNRjWQYo", "73eSiVcg4tQ", "9M-B5qU7ezY", "LhrGS4-Dd9I", "V7H1oUHXPkg", "EKKe7DBZVhI", "SZF5K8epWko", "Ncg1HB5uVLc", "Eh0j5nHhS6I", "h72iwhmB6zc", "DK1lCc9b7bg", "Y6JsEja15Vk", "kGrk6V8tWDY", "-h3Oqhl8fPg", "0isM0GF-rMI", "vbGwcvXgDlg", "NIG3l8oWKYE", "tbQ_7zvRoN4", "oUgDaEwMbiU", "aOSlXuDO4UU", "3zU90x0OZ0Y", "12 |
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
"^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:/\S*)?$" |
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
from copy import deepcopy | |
class MagicSetter(object): | |
def __setattr__(self, name, value): | |
super(MagicSetter, self).__setattr__(name, deepcopy(value)) | |
m = MagicSetter() | |
m.a = ["this", "is", "the", "original", "list"] |