Skip to content

Instantly share code, notes, and snippets.

View sammdec's full-sized avatar

Sam Mason de Caires sammdec

View GitHub Profile
@akirattii
akirattii / generate-entropy-on-mouse-moving.js
Created August 26, 2018 23:07
JS: How to generate a random entropy by mouse-moving on browser
// const entropy = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
const entropy = [];
let captureStart = false;
/**
* Mouse Moving Entropy Generator on browser.
* Returns an entropy which is 16 bytes long array of unsigned char integer (0-255).
*/
$(document).on("mousemove", "html", function(e) {
const MAX_LEN = 16; // size of entropy's array
@tsulej
tsulej / harmonograph.pde
Created March 23, 2017 12:42
Harmonograph + noise
// http://generateme.tumblr.com
// Harmonograph with noise
// space - save
// click - change
float time;
float f1,f2,f3,f4;
float p1,p2,p3,p4;
float a1,a2,a3,a4;
@mikker
mikker / Connected.js
Last active January 11, 2017 13:10
Higher Order Function for Redux with Next.js
import { Component } from 'react'
import { Provider, connect } from 'react-redux'
import { reducer, initStore } from './store'
export default function Connected (...args) {
return function (Comp) {
return class StoreComponent extends Component {
static getInitialProps ({ req }) {
const isServer = !!req
const store = initStore(reducer, undefined, isServer)
@bendc
bendc / easing.css
Created September 23, 2016 04:12
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.