Skip to content

Instantly share code, notes, and snippets.

@TheDarkTrumpet
TheDarkTrumpet / create_flashcards.py
Created January 2, 2024 18:03
A script/program that can take chapters of a book, run LangChain summarization against it, and create flashcards. Please see the linked web article (in comments) for details
"""
create_flashcards.py
This script is used to generate flashcards from a PDF file. It uses the LLM model to generate a list of
definitions and concepts from a PDF file. It then takes this list and generates a
JSON file that can be used to generate an Anki deck.
This script is a companion to the blog post: https://thedarktrumpet.com/programming/2024/01/02/generative-ai-flashcards/
This script relies on a .env file to provide the following variables:
@hlfshell
hlfshell / ultralearning.md
Created January 15, 2023 22:08
Ultralearning Notes

Ultralearning

The following is the notes I took years ago on the book Ultralearning by Scott Young. The bombastic title and promise to learn virtually anything quickly makes it sound as if its the typical marketing-powered fluff-filled nonfiction book stores are overflowing with, but something about this book stuck with me. After finishing it I quickly went back and wrote these thoughts down. While I don't follow his layout of plans regularly, I have used it to guide a lot of my own self education.

I've successfully utilized it when I needed to refresh on mathematics for my Master's degree (a host of skills that atrophied sigificantly for the dozen years between undergrad and the masters). I've also used it to self-study subjects like Robotics and Deep Learning (though I did decide in the end to go for the Master's accreditation).

I share it here with hopes that someone finds it useful.


Principle 1 - Metalearning

@4wk-
4wk- / README.md
Last active February 23, 2026 14:39
Clean uninstall then reinstall of WSL on Windows 10, with systemD support

Uninstall then reinstall WSL on Windows 10 (clean way)

Background

I've been using wsl (version 2) with genie mod for years without issue, but one day, Windows 10 finally catch up on wsl Windows 11 features and gives us a way to use systemD natively.

I wanted to use the new "right way" to enable systemD on Windows Subsystem for Linux (without genie), and I also had a (probably related) infinite Windows RemoteApp error poping in.

Fixing it

A - Uninstall wsl and related stuff

  1. In powershell (as admin)
@tanaikech
tanaikech / submit.md
Last active May 27, 2025 13:26
Creating Quizzes in Google Form using Google Forms API with Google Apps Script

Creating Quizzes in Google Form using Google Forms API with Google Apps Script

This is a sample script for creating quizzes in Google Form using Google Forms API with Google Apps Script. Recently, Google Forms API has been officially published, and it got to be able to be used by users. By this, quizzes in Google Form can be created using Google Forms API.

Here, there is one thing that can be achieved by Google Forms API. When Google Forms API is used, each choice in each question can be shuffled. This cannot be achieved with Google Forms Service (FormApp).

Usage

@feo52
feo52 / sample.csv
Last active May 4, 2024 15:00
Python pywin32(win32com) : Excel
14159 26535 89793 23846 26433 83279 5028 841971 69399 37510
58209 74944 59230 78164 06286 20899 8628 034825 34211 70679
82148 08651 32823 06647 09384 46095 5058 223172 53594 08128
48111 74502 84102 70193 85211 05559 6446 229489 54930 38196
44288 10975 66593 34461 28475 64823 3786 783165 27120 19091
45648 56692 34603 48610 45432 66482 1339 360726 02491 41273
72458 70066 06315 58817 48815 20920 9628 292540 91715 36436
78925 90360 01133 05305 48820 46652 1384 146951 94151 16094
33057 27036 57595 91953 09218 61173 8193 261179 31051 18548
07446 23799 62749 56735 18857 52724 8912 279381 83011 94912
@matt-peters
matt-peters / pytorch_tensorflow.py
Created June 15, 2020 18:02
Pytorch + tensorflow running together in the same computational graph
"""
An example of running both pytorch and tensorflow in the same network,
while pasing weights and gradients between the two.
In this example, we run a simple 2-layer feed-forward network,
with the first layer size (5, 2) and the second (2, 3).
The code contains an implementation of forward/backward passes with
three versions:
* tensorflow only
* pytorch only
@matiaslopezd
matiaslopezd / webhook.header.txt
Last active September 5, 2025 07:09
Woocommerce webhook payload and header example
expect 100-continue
content-length 1998
connection close
x-wc-webhook-delivery-id 36e520ebabc2fa725092ff4a47acedf2
x-wc-webhook-id 3
x-wc-webhook-signature 5poyFy4qB6fdvvT5pGbefZmfkpL48uD47F0WYwfmpo4=
x-wc-webhook-event created
x-wc-webhook-resource order
x-wc-webhook-topic order.created
x-wc-webhook-source https://www.website.com/
@akexorcist
akexorcist / buddhist-year.js
Last active April 25, 2024 10:20
MomentJS with Buddhist year
module.exports = {
toBuddhistYear: (moment, format) => {
var christianYear = moment.format('YYYY')
var buddhishYear = (parseInt(christianYear) + 543).toString()
return moment
.format(format.replace('YYYY', buddhishYear).replace('YY', buddhishYear.substring(2, 4)))
.replace(christianYear, buddhishYear)
}
}
@smeschke
smeschke / save_pose_data.py
Last active April 7, 2023 07:08
Saving pose data from video using OpenPose
import cv2, numpy as np, csv
#https://github.com/opencv/opencv/blob/master/samples/dnn/openpose.py
outfile_path = '/home/stephen/Desktop/workout.csv'
protoFile = "/home/stephen/pose/mpi/pose_deploy_linevec_faster_4_stages.prototxt"
weightsFile = "/home/stephen/pose/mpi/pose_iter_160000.caffemodel"
net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile)
data, input_width, input_height, threshold, frame_number = [], 368, 386, 0.1, 0