Skip to content

Instantly share code, notes, and snippets.

View shamansir's full-sized avatar

Ulric Wilfred shamansir

View GitHub Profile
@echophon
echophon / orca_x_hydra.js
Last active September 28, 2022 21:05
orca_x_hydra.js
// Example of OSC control of Hydra video synth w/Orca programming language
// by Yancy Way (echophon)
//
// https://github.com/hundredrabbits/Orca
// https://github.com/ojack/hydra
// https://github.com/ojack/hydra-examples
// https://atom.io/packages/atom-hydra
//
// Prerequisites: Orca, Atom, Atom-hydra extension
//
@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
@vyorkin
vyorkin / either-ex.hs
Created February 16, 2018 14:26
either-ex
module Evaluator where
import Data.Char
import qualified Data.Map as M
newtype Evaluator a = Ev (Either String a)
instance Functor Evaluator where
fmap f (Ev a) = Ev $ fmap f a
@nqthqn
nqthqn / plugins.md
Created August 22, 2017 23:42
Elm Plugins for vscode
@kritzcreek
kritzcreek / Kinds-and-do-syntax.md
Last active March 28, 2020 11:51
Kinds and Do-Syntax

Kinds

In PureScript there are types of different kinds. Kinds are types for types. For example Int has kind Type, and we write it as Int :: Type. You can ask for the kind of a type in purs psci

> :k Int
Type

Type constructors take types to other types. For example Array (which still needs another type to form a type a value could have, like Array Int):

@roovo
roovo / CanvasTexture.elm
Created April 11, 2017 16:07
elm: stuff wot I did to get text from canvas into webGL
module CanvasTexture exposing (canvasTexture)
-- imports are weird for Native modules
-- You import them as you would normal modules
-- but you can't alias them nor expose stuff from them
import Task exposing (Task)
import WebGL exposing (Error, Texture)
import Native.CanvasTexture
-- this will be our function which returns a number plus one
autoload -U colors && colors
autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}•'
zstyle ':vcs_info:*' unstagedstr '%F{yellow}•'
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' enable git svn
theme_precmd () {
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
@adamterlson
adamterlson / Propsal.md
Last active October 24, 2021 16:59
Lightning talk proposal for the Reactive 2016 Conference: Reconceptualizing react applications as a function

Lightning talk proposal for the Reactive 2016 Conference. Here's a handy retweet link

If you want to hear this talk, or if you just want to support me, please star ⭐ the Gist!

When I started writing React apps, I approached components as if they were “just the V in MVC!” Seriously, we’ve all heard it.

I have found this to be an inferior way of thinking about and building React applications. It makes people treat React as a drop-in replacement for something like a Backbone or Angular 1.x View. In other words, people treat it like a glorified template system with partials and don’t harness the power of its functional paradigms.

This talk is about a functional way to write and conceptualize entire React applications.

@yang-wei
yang-wei / destructuring.md
Last active February 20, 2024 04:40
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@paulirish
paulirish / what-forces-layout.md
Last active May 11, 2024 00:41
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent