Skip to content

Instantly share code, notes, and snippets.

Avatar

J. Voigt joyrexus

View GitHub Profile
@joyrexus
joyrexus / README.md
Last active Sep 28, 2020
collapsible markdown
View README.md

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@joyrexus
joyrexus / install.py
Last active Sep 26, 2020
Shopify App Installation URL via AWS Lambda (Python)
View install.py
# https://help.shopify.com/api/guides/authentication/oauth#scopes
scopes = []
scopes.append('read_content')
scopes.append('write_content')
scopes.append('read_themes')
scopes.append('write_themes')
scopes.append('read_products')
scopes.append('write_products')
scopes.append('read_customers')
@joyrexus
joyrexus / README.md
Last active Sep 25, 2020 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods
View README.md

Sans jQuery

Events

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

Hi:

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

A simple filter:

perl -ne 'print if /REGEX/'

Filter out blank lines (in place):

@joyrexus
joyrexus / README.md
Last active Sep 20, 2020
The Stable Marriage Problem
View README.md

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
joyrexus / README.md
Last active Sep 20, 2020 — forked from btoone/curl.md
curl tutorial
View README.md

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

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

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.
http://www.opensource.org/licenses/mit-license.php
@joyrexus
joyrexus / README.md
Last active Sep 15, 2020
File upload POST with curl
View README.md

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
joyrexus / README.md
Last active Sep 12, 2020
POST with curl
View README.md

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 https://foo.io/users/joyrexus/shoes, the canonical address for the shoes resource (a "collection" resource, in REST-speak) of a particular user (joyrexus):

@joyrexus
joyrexus / README.md
Last active Aug 26, 2020 — forked from dergachev/GIF-Screencast-OSX.md
Create a GIF screencast
View README.md

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

Instructions

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

You can’t perform that action at this time.