Skip to content

Instantly share code, notes, and snippets.

@jsupertramp
jsupertramp / GermanPrepQuiz.py
Last active November 15, 2017 11:30 — forked from anonymous/GermanPrepQuiz.py
GermanPrepQuiz created by jmesk8 - https://repl.it/@jmesk8/GermanPrepQuiz
import random
import time
#I have a working function for riddles where i only need to pass the keys and values as arguments!
def riddle(key, value):
attempt = input("What preposition goes with: %s ?\n>>>" % (key))
while attempt != value:
print("Wrong! Try again.(or press s to skip)")
attempt = input("What's the answer? : ")
if attempt == "s":
@ndunn219
ndunn219 / srt_to_txt.py
Last active July 30, 2025 02:46
Simple Python Script for Extracting Text from an SRT File
"""
Creates readable text file from SRT file.
"""
import re, sys
def is_time_stamp(l):
if l[:2].isnumeric() and l[2] == ':':
return True
return False
@raineorshine
raineorshine / memrise-export.js
Last active December 1, 2021 17:02
Export Memrise course words to CSV. There is also a Chrome Extension: https://chrome.google.com/webstore/detail/memrise-export/hcllgkpmoiolndnhmbdceffaidjmkoam
/*
UPDATE: This is now a Chrome Extension: https://chrome.google.com/webstore/detail/memrise-export/hcllgkpmoiolndnhmbdceffaidjmkoam
Source Code: https://github.com/raineorshine/memrise-export
Export Memrise course words to CSV (technically TSV, or "tab separated file", but it is effectively the same).
1. Log into Memrise.
2. Navigate to the course page you would like to export (e.g. https://app.memrise.com/course/2156672/german-random-01/).
3. Open the browser's Developer Console (https://support.airtable.com/hc/en-us/articles/232313848-How-to-open-the-developer-console)
@destan
destan / text2png.py
Last active January 10, 2024 06:32
Python text to image (png) conversion with automatic new line calculation
# coding=utf8
import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
def text2png(text, fullpath, color = "#000", bgcolor = "#FFF", fontfullpath = None, fontsize = 13, leftpadding = 3, rightpadding = 3, width = 200):
REPLACEMENT_CHARACTER = u'\uFFFD'
NEWLINE_REPLACEMENT_STRING = ' ' + REPLACEMENT_CHARACTER + ' '