Skip to content

Instantly share code, notes, and snippets.

View cimi's full-sized avatar
☀️

Alex Ciminian cimi

☀️
View GitHub Profile
@johnhw
johnhw / umap_sparse.py
Last active January 6, 2024 16:09
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
@Avaq
Avaq / combinators.js
Last active May 1, 2024 09:38
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@jsdf
jsdf / immutableJSFormatter.js
Last active May 19, 2022 10:51
Chrome devtools formatter for Immutable-js
const immutableJSFormatter = {
header(x) {
if (x && x.toJS) return ['span', {}, x.toString()];
return null;
},
hasBody(x) {
return x && x.toJS;
},
body(x) {
return ['span', {}, JSON.stringify(x.toJS(), null, 2)];
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X 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:

@Breefield
Breefield / hexagon.js
Created August 12, 2012 04:12
Drawing a Hexagon with Paper.js
// Create a Paper.js Path to draw a line into it:
var hexagon = new Path();
// Color our path black
hexagon.strokeColor = 'black';
// How many points do we want our object to have
var points = 6;
// How large should it be
var radius = 60;
// 0 to 2PI is a circle, so divide that by the number of points
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"