Skip to content

Instantly share code, notes, and snippets.

View Tower450's full-sized avatar

Jonathan Tourangeau Tower450

  • Montreal, QC Canada
View GitHub Profile
import pytesseract
import sys
import argparse
try:
import Image
except ImportError:
from PIL import Image
from subprocess import check_output
@mdonkers
mdonkers / server.py
Last active May 6, 2024 23:32
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@philosopherdog
philosopherdog / youtube-dl-cheat.txt
Created March 21, 2017 13:08
youtube-dl cheat sheet
# Basic Download:
youtube-dl URL
# Download Playlist, put in folder, and index with order:
youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' URL
# Download to /$uploader/$date/$title.$ext:
youtube-dl -o '%(uploader)s/%(date)s/%(title)s.%(ext)s' URL
# Download playlist starting from certain video:
@andromedarabbit
andromedarabbit / elastalert-rule.yaml
Created March 3, 2017 15:44
ElastAlert rule example
# Alert when the rate of events exceeds a threshold
# (Required)
# Rule name, must be unique
name: OutOfMemoryError
# (Required)
# Type of alert.
# the frequency rule type alerts when num_events events occur with timeframe time
type: frequency
@Nicholas-Swift
Nicholas-Swift / astar.py
Last active May 12, 2024 18:34
A* pathfinding algorithm. Please see comments below for a fork of this gist that includes bug fixes!
class Node():
"""A node class for A* Pathfinding"""
def __init__(self, parent=None, position=None):
self.parent = parent
self.position = position
self.g = 0
self.h = 0
@dreamorosi
dreamorosi / standardJS-in-CRA.md
Last active August 16, 2022 17:33
Add Standard JS to create-react-app project

Standard JS in create-react-app

I've been using create-react-app lately as I find it very useful to kick things off while starting a project. I almost always follow JavaScript Standard Style and I found myself googling it so I figured out I should write it down.

Get Standard JS

I really like keeping dependencies as local as possible but if you prefer you can install it globally.

yarn add standard --dev

or

### Welcome to the InfluxDB configuration file.
# Once every 24 hours InfluxDB will report usage data to usage.influxdata.com
# The data includes a random ID, os, arch, version, the number of series and other
# usage data. No data from user databases is ever transmitted.
# Change this option to true to disable reporting.
reporting-disabled = false
# we'll try to get the hostname automatically, but if it the os returns something
# that isn't resolvable by other servers in the cluster, use this option to
@juhaelee
juhaelee / react-typescript.md
Last active January 26, 2023 00:52
React + Typescript Cheatsheet

React + Typescript Cheatsheet

Setup

If you use atom... download & install the following packages:

What are Typescript type definition files? (*.d.ts)

@dchowitz
dchowitz / es6-debugging-in-vscode.md
Last active August 30, 2023 06:23
Debugging ES6 in VS Code

Debugging ES6 in VS Code

My current editor of choice for all things related to Javascript and Node is VS Code, which I highly recommend. The other day I needed to hunt down a bug in one of my tests written in ES6, which at time of writing is not fully supported in Node. Shortly after, I found myself down the rabbit hole of debugging in VS Code and realized this isn't as straightforward as I thought initially. This short post summarizes the steps I took to make debugging ES6 in VS Code frictionless.

What doesn't work

My first approach was a launch configuration in launch.json mimicking tape -r babel-register ./path/to/testfile.js with babel configured to create inline sourcemaps in my package.json. The debugging started but breakpoints and stepping through the code in VS Code were a complete mess. Apparently, ad-hoc transpilation via babel-require-hook and inline sourcemaps do not work in VS Code. The same result for attaching (instead of launch) to `babel-node