Skip to content

Instantly share code, notes, and snippets.

View joyrexus's full-sized avatar

J. Voigt joyrexus

View GitHub Profile
@joyrexus
joyrexus / README.md
Last active May 3, 2024 10:41 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@joyrexus
joyrexus / README.md
Last active April 14, 2024 14:35 — forked from dergachev/GIF-Screencast-OSX.md
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

Instructions

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

@joyrexus
joyrexus / README.md
Last active January 21, 2024 21:51 — forked from btoone/curl.md
curl tutorial

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 / http-errors.js
Created June 6, 2016 23:30 — forked from moleike/http-errors.js
HTTP Error classes in Node.js
'use strict';
const statusCodes = require('http').STATUS_CODES;
function createError(code, name) {
return function(message) {
Error.captureStackTrace(this, this.constructor);
this.name = name;
this.message = message;
this.statusCode = code;
}
@joyrexus
joyrexus / README.md
Last active February 1, 2023 08:51 — 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.
http://www.opensource.org/licenses/mit-license.php
@joyrexus
joyrexus / README.md
Last active April 27, 2022 00:49 — forked from tristanwietsma/auth.go
golang web examples
@joyrexus
joyrexus / README.md
Created October 31, 2013 01:49 — forked from mbostock/.block
The Gist to Clone All Gists

Run like so:

node gist-clone-all.js username

You'll want to replace "username" with your own username.

This script clones using the push URL, so you should probably be the owner of the gists. You could also use this to clone someone else's gists, but in that case you may wish to edit the code to use gist_pull_url instead.

@joyrexus
joyrexus / install.py
Last active September 26, 2020 05:55
Shopify App Installation URL via AWS Lambda (Python)
# 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 / lambda-concurrency-to-cloudwatch.py
Created August 11, 2018 02:08 — forked from innovia/lambda-concurrency-to-cloudwatch.py
Lambda concurrent execution custom metric on CloudWatch
#!/usr/bin/env python
import boto3
import datetime
import time
ENABLED_REGIONS = [
"us-east-1",
"us-west-2",
"eu-west-1",
"eu-central-1",
@joyrexus
joyrexus / mocha-guide-to-testing.js
Last active October 6, 2017 02:33 — forked from samwize/mocha-guide-to-testing.js
quick overview of mocha testing
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()