Skip to content

Instantly share code, notes, and snippets.

@albertsun
albertsun / linebreaks_wp.py
Created August 21, 2011 05:44
Python port of WordPress's wpautop filter
import re
from django import template
from django.utils.functional import allow_lazy
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe, SafeData
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.text import normalize_newlines
register = template.Library()
@bitingsock
bitingsock / speed-between-subs.lua
Last active October 1, 2023 06:28
Increases playback speed if a subtitle has not been displayed; resumes normal speed when a new subtitle is shown
---user settings---
local WaitTime = 0.1 --how long until we try to enter "fast" mode
local lookAhead = 5 --how far ahead to look for subtitles when trying to enter "fast" mode
local fast = 6 --how fast "fast" mode is by default
local rewind = 0.2 --how far to rewind when entering normal mode; note that if this is more than or equal to WaitTime + lookAhead you will probably enter an infinite loop
---
local searchtimer
local checktimer
local waitTimer
local normal = mp.get_property("speed")
@settinger
settinger / wordle_derivations.md
Last active December 8, 2023 09:14
Wordle Derivations

Wordle Derivations, Localizations, Translations, and Variations

Go to this page by Júda Ronén for a more complete and prettier list!

Part 1: Wordle derivations that already exist

NOTA BENE: Some of these may have existed before

English

  • Wordle - the original, limited to one word per day
local sense=-20
local speed = mp.get_property("speed")
local detect = false
function f(msg)
if string.find(msg.text, "silence_end") and detect then
mp.set_property("speed",speed)
endmsg=msg.text
detect = false
--print("end")
elseif string.find(msg.text, "silence_start") and detect==false then
@tylerneylon
tylerneylon / learn.lua
Last active April 28, 2024 22:23
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@huytd
huytd / wordle.md
Last active May 2, 2024 12:13
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@HaleTom
HaleTom / print256colours.sh
Last active May 2, 2024 14:43
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@Pathoschild
Pathoschild / stardew-mod-recommendations.md
Last active May 8, 2024 06:37
Stardew Valley mod recommendations

Here are the mods I recommend. These are all compatible with the latest versions of SMAPI and Stardew Valley on Linux/macOS/Windows. See the player's guide to using mods if you're interested.

Quality of life

I think the best mods are those which improve the game while maintaining its balance, lore, and style.

  • AutoGate
    Gates open automatically when you approach and close behind you.

  • Better Sprinklers Plus
    Customise the sprinkler radius, with a proportional change to their cost. If you're willing to mine all the ores you'll need, that makes the basic sprinklers useful early in the game and lets you do more than just watering crops every day.

@kelciour
kelciour / README.md
Last active May 8, 2024 09:58
Welcome to My Personal Page 📄
@dustin
dustin / zen_stories.org
Created January 27, 2011 08:08
101 Zen Stories in org-mode

A Cup of Tea

Nan-in, a Japanese master during the Meiji era (1868-1912), received a university professor who came to inquire about Zen.

Nan-in served tea. He poured his visitor’s cup full, and then kept on pouring.

The professor watched the overflow until he no longer could restrain himself. “It is overfull. No more will go in!”