Skip to content

Instantly share code, notes, and snippets.

View thecodingchicken's full-sized avatar

thecodingchicken thecodingchicken

View GitHub Profile
@thecodingchicken
thecodingchicken / get_vitalsource.py
Created August 17, 2020 21:49
get_vitalsource1
from subprocess import Popen
import pywinauto
from pywinauto.application import Application
import autopy
import cv2
from gui_automation import GuiAuto
import gui_automation
import os
import time
import pyautogui
@protrolium
protrolium / ffmpeg.md
Last active May 3, 2024 18:58
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@dcloud
dcloud / elec_shopping_ch1.markdown
Last active August 14, 2023 14:29
Make Electronics Shopping List

Chapter 1 Parts List

Tools

###Small pliers

RadioShack 4.5-inch mini long-nose pliers, part number 64-0062, or Xcelite 4-inch mini long-nose pliers, model L4G. Or similar. The brand is unimportant. After you use them for a while, you'll develop your own preferences. In particular, you have to decide whether you like spring-loaded handles. If you decide you don't, you'll need a second pair of pliers to pull the springs out of the first.

I have small pliers, probably okay.

(defn signum [x] (if (zero? x) x (if (pos? x) 1 -1)))
(defn connect [{:keys [width height]} {fx :x, fy :y, fw :w, fh :h} {tx :x, ty :y, tw :w, th :h}]
(let [x0 (+ fx (rand-int fw)), y0 (+ fy (rand-int fh))
x1 (+ tx (rand-int tw)), y1 (+ ty (rand-int th))
dx (signum (- x1 x0)), dy (signum (- y1 y0))]
(loop [x x0, y y0, points #{}, horizontal? (= (rand-int 2) 0)]
(if (and (= x x1) (= y y1)) points
(let [[x y] (if (or (= y y1) (and horizontal? (not= x x1))) [(+ x dx) y] [x (+ y dy)])]
(if-not (and (> x 0) (> y 0) (< x width) (< y height)) points