Skip to content

Instantly share code, notes, and snippets.

@ephsmith
ephsmith / Makefile
Created February 7, 2019 10:13 — forked from kristopherjohnson/Makefile
Makefile that uses Pandoc to generate HTML, PDF, DOCX, etc. from Markdown source files
# Makefile
#
# Converts Markdown to other formats (HTML, PDF, DOCX, RTF, ODT, EPUB) using Pandoc
# <http://johnmacfarlane.net/pandoc/>
#
# Run "make" (or "make all") to convert to all other formats
#
# Run "make clean" to delete converted files
# Convert all files in this directory that have a .md suffix
@ephsmith
ephsmith / GIF-Screencast-OSX.md
Created May 16, 2018 18:07 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ephsmith
ephsmith / README.md
Created May 1, 2018 11:31 — forked from xavriley/README.md
Original NES Mario Theme for Sonic Pi

Making Chiptune Music using Sonic Pi v2.0

Warning: this might not work on a RaspberryPi yet

I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.

I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!

Getting the sounds of the NES chip

<?php
function tiny_url($url) {
return file_get_contents('http://tinyurl.com/api-create.php?url=' . $url);
}
$json = json_decode(file_get_contents('php://input'));
echo tiny_url($json->url);
/* basic jQuery usage:
$.post('https://foo.bar/tiny-url-api.php', JSON.stringify({url: url_2b_shortened}))