Skip to content

Instantly share code, notes, and snippets.

View mattearnshaw's full-sized avatar

Matt Earnshaw mattearnshaw

View GitHub Profile
@mxactvtd
mxactvtd / TidalCyclesQuickReferenceStub.tidal
Last active August 15, 2024 14:40
TidalCycles Quick Reference compiled and partially rewritten documentation from various sources
---- TidalCycles QUICK REFERENCE ----
----------------------------------------------------------------
-- To use in your editor after or alongside your code for quick reference
-- Work in progress, mostly to be used as basis for further documnentation work, sorry for the errors and omissions
-- designed with atom - monokai one dark vivid as theme
-- https://gist.github.com/mxactvtd/bf3fb357a419c7f063b98dfd9a66cf78 - check for update, I keep updating this quite often atm
----------------------------------------------------------------
-- Some sources of Documentation --
-- https://tidalcycles.org/patterns.html
-- https://tidalcycles.org/functions.html

Things that programmers don't know but should

(A book that I might eventually write!)

Gary Bernhardt

I imagine each of these chapters being about 2,000 words, making the whole book about the size of a small novel. For comparison, articles in large papers like the New York Times average about 1,200 words. Each topic gets whatever level of detail I can fit into that space. For simple topics, that's a lot of space: I can probably walk through a very basic, but working, implementation of the IP protocol.

--- a/w3mimg/x11/x11_w3mimg.c 2004-11-08 12:14:06.000000000 -0500
+++ b/w3mimg/x11/x11_w3mimg.c 2015-03-12 23:23:44.964555734 -0400
@@ -214,9 +214,12 @@
Pixmap p;
GC gc;
XImage *i;
+ XWindowAttributes attr;
+
+ XGetWindowAttributes(xi->display, xi->window, &attr);
@comboy
comboy / core.hook
Created January 3, 2015 22:46
Simple tool for playing with multiline hoon. After putting it in /main/app/run/core.hook, create `/try/run/moo.hoon` execute `:run %moo` and stay in your editor while watching what happens when you try to compile random characters as hoon.
/- term-line
!:
|%
++ axle
$% [%0 prog=@tas]
==
++ clay-gift
$% [%ergo p=@p q=@tas r=@ud]
[%note p=@tD q=tank]
[%writ p=riot]
@comboy
comboy / 1.mars
Last active August 29, 2015 14:11
baby steps
!:
|_ [hid=hide ~]
++ poke-mars-args
|= [ost=bone you=ship *]
:_ +>.$
:- [ost %pass / %g %cide %$]
:- [ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
=- [ost %give %rush %tang -]
@adeel
adeel / instiki_to_mediawiki.py
Last active December 6, 2017 14:54
conversion script from instiki to mediawiki (in progress)
# instiki_to_mediawiki.py
from optparse import OptionParser
import os.path
import re
import cgi
import sys
import subprocess
category_regex = re.compile(r"(:)?category\s*:(.*)", re.IGNORECASE)
@dllud
dllud / pdfocr
Created February 9, 2014 01:10
pdfocr - script to transform a PDF containing a scanned book into a searchable PDF
#!/bin/bash
# This is a script to transform a PDF containing a scanned book into a searchable PDF.
# Based on previous script and many good tips by Konrad Voelkel:
# http://blog.konradvoelkel.de/2010/01/linux-ocr-and-pdf-problem-solved/
# http://blog.konradvoelkel.de/2013/03/scan-to-pdfa/
# Depends on convert (ImageMagick), pdftk and hocr2pdf (ExactImage).
# $ sudo apt-get install imagemagick pdftk exactimage
# You also need at least one OCR software which can be either tesseract or cuneiform.
# $ sudo apt-get install tesseract-ocr
@MicahElliott
MicahElliott / colortrans.py
Created November 29, 2010 07:57
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code