Skip to content

Instantly share code, notes, and snippets.

Avatar
I'm hiring @hodinkee

Mark Wunsch mwunsch

I'm hiring @hodinkee
View GitHub Profile
@mwunsch
mwunsch / broadcast.rkt
Last active Dec 22, 2020
!!con 2018 Presentation - Overscan
View broadcast.rkt
#lang overscan
(require overscan/macos
overscan/draw
(only-in racket/file make-temporary-file)
racket/draw
(only-in racket/math pi)
"twitch-secret.rkt")
(define cam+screen
@mwunsch
mwunsch / Main.elm
Last active Mar 22, 2017
Elm Boilerplate
View Main.elm
module Main exposing (..)
-- Stick this Elm file in a directory. Run `elm make` in the
-- directory. Run `elm reactor`. Now you have an Elm program.
import Html exposing (..)
main : Program Never Model Msg
main =
@mwunsch
mwunsch / index.js
Last active Jul 20, 2016
CFN Custom Resource - GitHub CodeDeploy webhook
View index.js
const response = require('cfn-response');
const http = require('https');
const url = require('url');
exports.handler = function(event, context) {
var props = event.ResourceProperties;
var options = {
hostname: 'api.github.com',
headers: {
'Accept': 'application/vnd.github.v3+json',
'Authorization': `token ${props.GitHubToken}`,
View REM_10PRINT_Variation_1.pde
void setup() {
size(1080, 1080);
noStroke();
background(0, 0, 255);
int rows = int(pow(2, int(random(1,6))));
int u = height / (rows + 4);
int thickness = int(pow(2, int(random(1, 4))));
int uth1 = u / thickness;
int uth2 = u + uth1;
int startX = int(-u * 0.75);
@mwunsch
mwunsch / dom-zipper.js
Last active Aug 29, 2015
A blah implementation of a Zipper for the DOM
View dom-zipper.js
/* I'm not thrilled with this, but it should be enough to demonstrate ... something ... */
function Breadcrumb(el) {
this.path = el.parentElement ? new Breadcrumb(el.parentElement) : null;
this.left = el.previousElementSibling;
this.right = el.nextElementSibling;
}
function Zipper(tree, path) {
this.tree = tree;
this.crumb = new Breadcrumb(tree);
@mwunsch
mwunsch / dress.html
Created Apr 23, 2015
createTreeWalker + createDocumentFragment = diff
View dress.html
<!DOCTYPE html>
<html>
<head></head>
<body>
<div class="grid-thumb" id="grid-thumb-viv9" data-style-name="VIV9">
<a class="item-link" href="/shop/designers/vivienne_westwood_anglomania/julia_dress">
<div class="grid-thumb-images">
<img class="current" alt="Vivienne%20Westwood%20Anglomania - Julia%20Dress" width="270" height="405" src="https://pc-ap.renttherunway.com/productimages/front/270x/fc/VIV9.jpg">
<img alt="Vivienne%20Westwood%20Anglomania - Julia%20Dress" width="270" height="405" src="https://pc-ap.renttherunway.com/productimages/side/270x/fc/VIV9.jpg" class="">
<img alt="Vivienne%20Westwood%20Anglomania - Julia%20Dress" width="270" height="405" src="https://pc-ap.renttherunway.com/productimages/back/270x/fc/VIV9.jpg">
@mwunsch
mwunsch / viz.js
Created Apr 23, 2015
DOM -> Graphviz
View viz.js
/*
This is an incredibly rudimentary PhantomJS script to walk a DOM and emit a graphviz `dot` document.
It is neither clever nor good.
Proceed with caution.
Usage: phantomjs viz.js http://2015.empirejs.org/ | tee >(dot -Tpng > test.png)
*/
var page = require('webpage').create();
var args = require('system').args;
View puthtml.sh
puthtml ()
{
curl -F "file=@${1:--};filename=${1:-`uuidgen`.html}" \
-F "api_key=${2:-$PUTHTML_API_KEY}" \
http://www.puthtml.com/;
}
View scrape.rb
require 'rumoji'
codepoints = Rumoji::Emoji::ALL.map(&:hex).map(&:downcase)
codepoints.each do |c|
puts "https://abs.twimg.com/emoji/v1/72x72/#{c}.png"
end
View keybase.md

Keybase proof

I hereby claim:

  • I am mwunsch on github.
  • I am wunsch (https://keybase.io/wunsch) on keybase.
  • I have a public key whose fingerprint is CE28 EDB9 BAD2 F531 7941 B65A 9E26 C63A DC75 6EEF

To claim this, I am signing this object: