Opinions are like assholes, every one has got one.
This one is mine.
Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.
| from collections import defaultdict | |
| from math import sqrt | |
| import httplib2 | |
| import json | |
| import re | |
| import threadpool | |
| import threading | |
| from PIL import Image,ImageDraw | |
| ACCESS_TOKEN = "..." |
The following recipes are sampled from a trained neural net. You can find the repo to train your own neural net here: https://github.com/karpathy/char-rnn Thanks to Andrej Karpathy for the great code! It's really easy to setup.
The recipes I used for training the char-rnn are from a recipe collection called ffts.com And here is the actual zipped data (uncompressed ~35 MB) I used for training. The ZIP is also archived @ archive.org in case the original links becomes invalid in the future.
| 'use strict'; | |
| /* eslint-disable consistent-this */ | |
| let middlewareManagerHash = []; | |
| /** | |
| * Composes single-argument functions from right to left. The rightmost | |
| * function can take multiple arguments as it provides the signature for | |
| * the resulting composite function. | |
| * |
| """Creates a python socket client that will interact with javascript.""" | |
| import socket | |
| socket_path = '/tmp/node-python-sock' | |
| # connect to the unix local socket with a stream type | |
| client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | |
| client.connect(socket_path) | |
| # send an initial message (as bytes) | |
| client.send(b'python connected') | |
| # start a loop |
| const hoverTime = 400 | |
| const fetchers = {} | |
| const doc = document.implementation.createHTMLDocument('prefetch') | |
| function fetchPage (url, success) { | |
| const xhr = new XMLHttpRequest() | |
| xhr.open('GET', url) | |
| xhr.setRequestHeader('VND.PREFETCH', 'true') | |
| xhr.setRequestHeader('Accept', 'text/html') | |
| xhr.onreadystatechange = () => { |
| Mute these words in your settings here: https://twitter.com/settings/muted_keywords | |
| ActivityTweet | |
| generic_activity_highlights | |
| generic_activity_momentsbreaking | |
| RankedOrganicTweet | |
| suggest_activity | |
| suggest_activity_feed | |
| suggest_activity_highlights | |
| suggest_activity_tweet |