Skip to content

Instantly share code, notes, and snippets.

View spoike's full-sized avatar
👓
I may be slow to respond.

Mikael Brassman spoike

👓
I may be slow to respond.
View GitHub Profile
@spoike
spoike / svg_paths_cheatsheet.md
Last active April 23, 2024 15:36
Cheatsheet for SVG paths

Cheatsheet for SVG Path Data

Straight line commands

+------------+-------------------+--------+
| *M* or *m* | moveto            | (x y)+ |
+------------+-------------------+--------+
| *Z* or *z* | close path        | (none) |
+------------+-------------------+--------+
@spoike
spoike / Dynamic.java
Created August 24, 2011 16:51
Example on how to do dynamic variable binding in Java
package dynamic;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
/**
* Console example application.
*
@spoike
spoike / curry.js
Created July 22, 2016 08:41
Simple implementation of a curry for teaching purposes
/*
* curry(fn: Function) => Function
* Simple implementation of currying a function
* Drawbacks:
* - Cannot be reused as stored args is mutable
* - Cannot use placeholders
* - Will not check argument overflow
*/
function curry(fn) {
var arity = fn.length; // check the arity of the given function
@spoike
spoike / gitproxy-socat
Last active March 5, 2022 16:47 — forked from sit/gitproxy-socat
A simple wrapper around socat to use as a git proxy command
#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny
@spoike
spoike / flexbox.md
Created April 19, 2014 08:53
Flexbox CSS Cheatsheet

Flexbox Cheatsheet

Flex Container

  • display: flex | inline-flex
  • flex-direction: row | row-reverse | column | column-reverse
  • flex-wrap: nowrap | wrap | wrap-reverse
  • justify-content: flex-start | flex-end | center | space-between | space-around
  • align-items: flex-start | flex-end | center | baseline | stretch
  • align-content: flex-start | flex-end | center | space-between | space-around | stretch
@spoike
spoike / test.txt
Created June 18, 2020 17:19
Boop Scripts: Convert between WKT and WKB
POINT(2.0 4.0)
010100000000000000000000400000000000001040
LINESTRING(2.0 4.0, 1.0 2.0)
01020000000200000000000000000000400000000000001040000000000000f03f0000000000000040
POLYGON ((30 10, 40 40, 20 40))
@spoike
spoike / sketch_aug31b.pde
Created August 31, 2011 12:02
Processing Sketch - Flames!
/**
* Flames. Generates some flames by using gradients (with basic
* spline math) and Perlin noise (for generating the flame
* height).
*/
/** Flame outer color */
color startCol = color(100, 0, 210);
/** Flame inner color */
color endCol = color(200, 150, 255);
@spoike
spoike / reflux.js
Created June 29, 2014 22:23
A simpler implementation of React.JS's Flux
var EventEmitter = require('events').EventEmitter,
_ = require('lodash');
/**
* Creates an action functor object
*/
exports.createAction = function() {
var action = new EventEmitter(),
eventLabel = "action",
@spoike
spoike / quadtree.pde
Created September 1, 2011 11:16
Quad Tree Visualization
/**
* Quad Tree implementation and visualization in Processing. Executes
* with Processing 1.5.1
*
* Adds points to a quad tree and shows visually as the quad tree
* splits and repushes the values as new values are added.
*
* Restart QuadTree with new values with a key press.
*/
### Keybase proof
I hereby claim:
* I am spoike on github.
* I am spoike (https://keybase.io/spoike) on keybase.
* I have a public key ASBid-dWl9jmwlyW9ZQYKyIQxCk4s88XiEd4nsrqno_Gsgo
To claim this, I am signing this object: