Skip to content

Instantly share code, notes, and snippets.

View sectore's full-sized avatar

Jens Krause sectore

View GitHub Profile
module Particle exposing (..)
import Array
import Task
import Html.App as App
import Window exposing (Size, resizes)
import Color exposing (Color, black, white, rgba)
import Element exposing (Element, toHtml)
import Collage exposing (Form, collage, move, rect, filled, circle)
import AnimationFrame exposing (times)
@yleflour
yleflour / wallaby.js
Last active July 13, 2024 17:29
Wallaby + React Native
/*
WallabyJS React Native Config
Works well with Jest + Enzyme
*/
/* eslint-disable */
module.exports = function (wallaby) {
return {
files: [
'src/**/*.js',
module Cycle where
import Almost (Stream, Promise, observe, Subject, holdSubject, next, complete, thenp)
import Data.StrMap (fromFoldable, StrMap, keys)
import Data.StrMap.Unsafe (unsafeIndex)
import Data.Tuple (Tuple(..))
import Prelude (map)
type Drivers a b = StrMap (Subject a -> b)
type Sinks a = StrMap (Stream a)
@milankinen
milankinen / monkey.js
Created April 8, 2016 07:27
Rx .log monkey
Rx.Observable.prototype.log = function(prefix) {
return process.env.NODE_ENV !== "development" ? this : this
.doOnCompleted(() => console.log(prefix, "<completed>")) // eslint-disable-line
.do(x => console.log(prefix, x)) // eslint-disable-line
}
// const obs = Rx.Observable.fromEvent(text, "input")
// .log("InputEvent:")
// .map(e => e.target.value)
// .filter(t => !!t)
@btroncone
btroncone / rxjs_operators_by_example.md
Last active September 14, 2025 16:48
RxJS 5 Operators By Example
@btroncone
btroncone / ngrxintro.md
Last active November 22, 2025 23:04
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@yang-wei
yang-wei / destructuring.md
Last active December 2, 2024 06: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"))
function counterA(state = 0, action) {
switch (action.type) {
case 'increment':
return state + 1
case 'decrement':
return state - 1
default:
return state
}
}
@cem2ran
cem2ran / main.js
Created December 28, 2015 01:10
React Getting Started - How it should be!
import React from 'react'
import ReactDOM from 'react-dom'
const Hello = ({name}) => <h1>Hello {name}!</h1>
ReactDOM.render(
<Hello name={"vjeux"}/>,
document.body.appendChild(document.createElement("div"))
)
@teropa
teropa / life.cljs
Created November 3, 2015 09:57
Conway's Life in ClojureScript
;; Credits:
;;
;; * ClojureScript
;; * Reagent https://reagent-project.github.io/
;; * Figwheel https://github.com/bhauman/lein-figwheel
;; * core.async https://clojure.github.io/core.async/
;; * Christophe Grand's Life implementation http://clj-me.cgrand.net/2011/08/19/conways-game-of-life/
(ns life.core
(:require [reagent.core :as r]