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
[ | |
{ | |
"description": "MouseButton5 to Ctrl+LeftArrow", | |
"manipulators": [ | |
{ | |
"from": { | |
"pointing_button": "button5" | |
}, | |
"to": [ | |
{ |
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 random | |
def get_deck(blacks, reds): | |
deck = ['B'] * blacks | |
red_position = random.randint(0, len(deck)) | |
for _ in range(reds): | |
deck.insert(red_position, 'R') | |
return deck |
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 logging import getLogger | |
import scrapy | |
from scrapy.extensions.feedexport import BlockingFeedStorage | |
logger = getLogger(__name__) | |
class GsFeedStorage(BlockingFeedStorage): |
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 time import sleep | |
import scrapy | |
from scrapy.extensions.feedexport import BlockingFeedStorage | |
class GsFeedStorage(BlockingFeedStorage): | |
def __init__(self, uri): | |
self.uri = uri |
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 time import time | |
SOLUTION_LIMIT = 100 | |
def get_solutions(num, total_sum, possible_vals, most_likely_val=None): | |
possible_vals = sorted(possible_vals) | |
# Histogram mapping shows what index a value has in the histogram array |
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 os | |
import shutil | |
import subprocess | |
from sys import argv | |
import scrapy | |
from scrapy.crawler import CrawlerProcess | |
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
""" | |
Usage: | |
$ python download.py *video_url* itag | |
<Stream: itag="22" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.64001F" acodec="mp4a.40.2"> | |
<Stream: itag="43" mime_type="video/webm" res="360p" fps="30fps" vcodec="vp8.0" acodec="vorbis"> | |
<Stream: itag="18" mime_type="video/mp4" res="360p" fps="30fps" vcodec="avc1.42001E" acodec="mp4a.40.2"> | |
<Stream: itag="36" mime_type="video/3gpp" res="240p" fps="30fps" vcodec="mp4v.20.3" acodec="mp4a.40.2"> | |
<Stream: itag="17" mime_type="video/3gpp" res="144p" fps="30fps" vcodec="mp4v.20.3" acodec="mp4a.40.2"> | |
$ python download.py *video_url* 22 video.mp4 |