Researched by Robert Quattlebaum [email protected].
Last updated 2020-02-03.
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
""" | |
Simple HTML -> Telegram entity parser. | |
""" | |
from collections import deque | |
from html import escape | |
from html.parser import HTMLParser | |
from typing import Iterable, Tuple, List | |
from telethon.helpers import add_surrogate, del_surrogate, within_surrogate, strip_text | |
from telethon.tl import TLObject |
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
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Text; | |
using System.Threading.Tasks; | |
/// <summary> | |
/// Process helper with asynchronous interface | |
/// - Based on https://gist.github.com/georg-jung/3a8703946075d56423e418ea76212745 | |
/// - And on https://stackoverflow.com/questions/470256/process-waitforexit-asynchronously | |
/// </summary> |
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 cv2 | |
import textwrap | |
img = np.zeros((500,500,3), dtype='uint8') | |
print(img.shape) | |
height, width, channel = img.shape | |
text_img = np.ones((height, width)) |
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
#!/usr/bin/env python3 | |
""" | |
To use: | |
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client | |
2. install pandoc and pypandoc, also tqdm | |
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials | |
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub | |
""" | |
import re | |
import sys |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# "Whattomine GPU Hash time calculator" | |
# | |
# This is not for CPU or ASIC calculations. | |
# Author: Brady Shea | |
# Email: Use github user: bmatthewshea or gist comments | |
# Origin: https://gist.github.com/bmatthewshea/90b120722e0561dd235adcdc231b6765 | |
# |
This is a guide for installing OpenCV 3.1 on Ubuntu 16.04 with Cuda 8 support. This has been tested using a system with a GeForce GTX 1060 and on one with a GeForce GTX 1080.
Install Nvidia drivers
# Start clean
sudo apt purge nvidia-*
# Add the PPA
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
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
require 'inifile' | |
require 'date' | |
Vagrant.configure("2") do |config| | |
config.vm.box = "dummy" | |
config.vm.guest = "windows" | |
config.vm.boot_timeout = 600 | |
config.vm.provider :aws do |aws, override| |
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
# Build environment. I use vagrant ubuntu/trusty64 | |
sudo apt-get install build-essential git-core alsa-base | |
sudo git clone https://github.com/raspberrypi/tools.git /opt/tools | |
export CCPREFIX="/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-" | |
# Get ffmpeg and x264 repos | |
git clone git://source.ffmpeg.org/ffmpeg.git |
NewerOlder