https://realpython.com/blog/python/django-development-with-docker-compose-and-machine/ https://www.syncano.io/blog/configuring-running-django-celery-docker-containers-pt-1/ https://www.compose.com/articles/using-json-extensions-in-postgresql-from-python-2/ http://capside.com/labs/deploying-full-django-stack-with-docker-compose/
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
var observeDOM = (function(){ | |
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver, | |
eventListenerSupported = window.addEventListener; | |
return function(obj, callback){ | |
if( MutationObserver ){ | |
// define a new observer | |
var obs = new MutationObserver(function(mutations, observer){ | |
if( mutations[0].addedNodes.length || mutations[0].removedNodes.length ) | |
callback(); |
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 math | |
def test_propotions(height, width): | |
"""checking the width and height of the number""" | |
return height/width == math.sqrt(2) | |
def get_dimensions(a, b): | |
"""checks it""" | |
if a > b: |
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
from functools import partial, wraps | |
def curry(f): | |
@wraps | |
def inner(*args, **kwargs): | |
return partial(f, *args, **kwargs) | |
return inner | |
@curry |
- Random variable distribution.
- Normal distribution.
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 requests | |
from multiprocessing import Queue, Process, Pool | |
from peewee import * | |
db = SqliteDatabase('github.db') | |
class Github(Model): | |
name = CharField(unique=True) | |
no_repos = IntegerField() | |
no_follower = IntegerField() |
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 numpy as np | |
import matplotlib.pyplot as plt | |
from scipy import stats | |
def hypothesis(x, theta): | |
"""function""" | |
return x.dot(theta).sum() | |
def compute_cost(X, Y, theta): | |
"""errors""" |
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
{"posts": {"children": [1, 2,3, 4], "new": {"hello": "world"}}} |
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 queue | |
from multiprocessing.managers import SyncManager | |
from multiprocessing import Process, RLock | |
from bs4 import BeautifulSoup | |
from urllib import request | |
from urllib.parse import urlparse, urljoin | |
from multiprocessing.managers import MakeProxyType | |
BaseSetProxy = MakeProxyType('BaseSetProxy', ('__and__', '__contains__', '__iand__', '__ior__', | |
'__isub__', '__ixor__', '__len__', '__or__', '__rand__', '__ror__', '__rsub__', |
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
"""scrape amazon laptop and desktop prices""" | |
import os | |
import queue | |
import asyncio | |
import warnings | |
import peewee as db | |
from multiprocessing.managers import SyncManager | |
from multiprocessing import Process, RLock | |
from data import data |