Skip to content

Instantly share code, notes, and snippets.

@WorldMaker
WorldMaker / celtx2renpy.py
Created March 31, 2010 23:27
Celtx to Ren'Py Script
#!/usr/bin/python
# Celtx HTML Film Script to Ren'Py Script Tool (Based on KeyLimePie tools)
# Copyright 2010 Max Battcher. Some Rights Reserved.
# Licensed for use under the Ms-PL.
from BeautifulSoup import BeautifulSoup, Tag
import logging
def tagtext(contents):
def txt(thing):
if isinstance(thing, Tag):
@WorldMaker
WorldMaker / use-blurhash.ts
Last active June 15, 2023 11:26
useBlurhash hook
import { decode } from 'blurhash'
import { useEffect, useState } from 'react'
function useBlurhash (blurhash: string, width: number, height: number, punch: number = 1) {
punch = punch || 1
const [url, setUrl] = useState(null as string | null)
useEffect(() => {
let isCancelled = false
@WorldMaker
WorldMaker / template-logger.test.ts
Last active December 15, 2022 03:45
Tagged Template Logger Wrapper for tslog
import { expect } from 'chai'
import { Logger } from 'tslog'
import { TemplateLogger } from './template-logger'
describe('Template Logger', () => {
const logs: any[] = []
const baseLogger = new Logger({ type: 'hidden' })
baseLogger.attachTransport((logObj) => logs.push(logObj))
afterEach(function () {
@WorldMaker
WorldMaker / Invoke-GitExpression.ps1
Last active August 3, 2022 20:24
PowerShell snippets
# A simple wrapper function for the pattern of run a command and if the command succeeds
# commit all the changes to git with a git commit message of the command line prefixed
# with a wrench (🔧)
function Invoke-GitExpression {
param(
[string[]]
[Parameter(ValueFromRemainingArguments)]
$Remaining
)
@WorldMaker
WorldMaker / Aurelia.Command.README.md
Last active June 3, 2016 02:08
Aurelia Command (Promise) Binding

A Command custom attribute that handles click triggers that return a promise, disabling the element while the promise runs, and does basic progress reporting with Toastr.

Example usage:

<button command.call="submit()">Save</button>
@WorldMaker
WorldMaker / waml.py
Created May 14, 2010 23:17
Wave Annotation Markup
# Simple, stupid Wave Annotation Markup
# Copyright 2010 Max Battcher. Licensed for use under the Ms-PL.
from google.appengine.ext.webapp import template
from waveapi import element
import yaml
def append_waml(blip, filename, context={}):
"""
Applies to the doc, which is expected to be a Wave API Document, the
transforms specified in an appropriate data structure loaded from a
@WorldMaker
WorldMaker / textapp.py
Created September 23, 2009 21:09
'Dirty' combined IM and SMS requests framework for AppEngine
#
# textapp -- Combined SMS and IM dispatching
# Copyright 2009 Max Battcher. All Rights Reserved.
#
# Microsoft Public License (Ms-PL)
#
# This license governs use of the accompanying software. If you use the
# software, you accept this license. If you do not accept the license,
# do not use the software.
#
@WorldMaker
WorldMaker / keybase.md
Last active August 29, 2015 14:06
keybase.md

Keybase proof

I hereby claim:

  • I am WorldMaker on github.
  • I am worldmaker (https://keybase.io/worldmaker) on keybase.
  • I have a public key whose fingerprint is 7E76 5A94 3B6B 60AD 1B63 F787 643F 13C6 9F27 CF77

To claim this, I am signing this object: