Skip to content

Instantly share code, notes, and snippets.


J. Voigt joyrexus

View GitHub Profile
joyrexus /
Last active Sep 28, 2020
collapsible markdown

collapsible markdown?


yes, even hidden code blocks!

print("hello world!")
joyrexus /
Last active Sep 26, 2020
Shopify App Installation URL via AWS Lambda (Python)
scopes = []
joyrexus /
Last active Sep 25, 2020 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery


// jQuery
$(document).ready(function() {
  // code
joyrexus /
Last active Sep 24, 2020
Perl one-liners


perl -e 'print "hello world!\n"'

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):

joyrexus /
Last active Sep 20, 2020
The Stable Marriage Problem

My implementation of the Gale/Shapley algorithm in Python. This algorithm is designed to address the Stable Marriage Problem.

Compare this recursive variant with the implementations on Rosetta Code.

Problem description

Given an equal number of men and women to be paired for marriage, each man ranks all the women in order of his preference and each women ranks all the men in order of her preference.

A stable set of engagements for marriage is one where no man prefers a women over the one he is engaged to, where that other woman also prefers that man over the one she is engaged to. I.e. with consulting marriages, there would be no reason for the engagements between the people to change.

joyrexus /
Last active Sep 20, 2020 — forked from btoone/
curl tutorial

An introduction to curl using GitHub's API.


Makes a basic GET request to the specifed URI


Includes HTTP-Header information in the output

joyrexus /
Last active Sep 18, 2020 — forked from joelambert/README
RAF replacements for setTimeout and setInterval

Drop in replace functions for setTimeout and setInterval that make use of requestAnimationFrame.

See overview article and Paul Irish's earlier post.

Courtesty of Joe Lambert

Copyright 2011, Joe Lambert.
Free to use under the MIT license.
joyrexus /
Last active Sep 15, 2020
File upload POST with curl

Extracted from this excellent curl tutorial

Back in late 1995 they defined an additional way to post data over HTTP. It is documented in the RFC 1867, why this method sometimes is referred to as RFC1867-posting.

This method is mainly designed to better support file uploads. A form that allows a user to upload a file could be written like this in HTML:

<!DOCTYPE html>
joyrexus /
Last active Sep 12, 2020
POST with curl

Below are a few examples of POSTing form data and file-uploads with curl.

For guidance on when to use which method, see form-data vs -urlencoded.

For details and more examples, see the POST section of the official tutorial.

In the examples below, suppose we need to POST data to, the canonical address for the shoes resource (a "collection" resource, in REST-speak) of a particular user (joyrexus):

joyrexus /
Last active Aug 26, 2020 — forked from dergachev/
Create a GIF screencast

Convert a 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


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

You can’t perform that action at this time.