Skip to content

Instantly share code, notes, and snippets.

@hayden-donnelly
hayden-donnelly / make_crop_labels.py
Last active January 27, 2024 04:29
Script to make square crop labels for images.
# Example usage:
# python make_crop_labels.py --input_path data/images --output_path --data/cropped_images --csv_path data/crops.csv
# Controls:
# scroll to change crop size, mouse to aim the crop, left click to crop image and move to next, x to skip to the next image.
# The script is pretty messy since I quickly hacked it together with little regard for quality, but it works.
import pygame
import argparse
@krishaantechnology
krishaantechnology / tailwind.config.js
Created February 12, 2023 01:25
Tailwind CSS: Shake Animation
const defaultTheme = require('tailwindcss/defaultTheme');
module.exports = {
purge: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./resources/js/**/*.vue',
],
@huytd
huytd / wordle.md
Last active May 16, 2024 20:39
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@lemariva
lemariva / 1-README.md
Last active January 7, 2022 22:07 — forked from ruario/1-README.md
A script that fetches a ChromeOS image for ARM32 and extracts the Widevine and Flash binaries, saving them in a compressed archive for use with Chromium for DRM

The included script 'widevine-flash_armhf.sh' fetches a ChromeOS image for ARM and extracts the Widevine and Flash binaries, saving them in a compressed archive. Since it downloads a fairly large file (2Gb+ on disk after download) it is recommended that you run the script on a raspberry that has plenty of disk space.

The files in the compressed archive are copied to the folder /usr/lib/chromium-browser/ To run the file just type the following:

sudo ./widevine-flash_armhf.sh

Check out this tutorial: https://lemariva.com/blog/2020/06/raspberry-pi-amazon-prime-netflix-and-drm-solution

@vsajip
vsajip / app.py
Created October 16, 2018 11:13
CLI starter template for Python logging cookbook
import argparse
import importlib
import logging
import os
import sys
def main(args=None):
scriptname = os.path.basename(__file__)
parser = argparse.ArgumentParser(scriptname)
levels = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL')
@DavidGoodwin
DavidGoodwin / tplink.sh
Created January 18, 2018 16:11
control a tplink HS100/HS110 smart plug from bash/the cli
@posener
posener / go-table-driven-tests-parallel.md
Last active July 10, 2024 13:19
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@yhilpisch
yhilpisch / 01_overview.md
Last active July 22, 2019 04:10
Gist for the For Python Quants Bootcamp in New York City, May 2017

For Python Quants Bootcamp

This is the Gist the FPQ bootcamp in New York, 08.-11. May 2017 (http://fpq.io)

Notebooks & Code Files

Additional files (eg Jupyter Notebooks) are found under:

from matplotlib import pyplot as plt
import cv2
img = cv2.imread('/Users/mustafa/test.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
plt.imshow(gray)
plt.title('my picture')
plt.show()
@sandeepraju
sandeepraju / ttfb.sh
Created July 20, 2016 21:17
curl command to check the time to first byte
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \