Skip to content

Instantly share code, notes, and snippets.

View kaosat-dev's full-sized avatar

Mark Moissette kaosat-dev

View GitHub Profile
@kaosat-dev
kaosat-dev / esnextbin.md
Last active April 27, 2017 18:04
esnextbin sketch
@kaosat-dev
kaosat-dev / commonjs-to-es6-modules.js
Created April 20, 2017 09:16 — forked from wegry/commonjs-to-es6-modules.js
purescript psc 0.9 output webpack loader that allows tree shaking
"use strict"
/*
* Webpack 2 loader that can take CommonJS output by psc 0.9.1 and convert
* it into tree shakable ES6 modules. No transpiling required.
*/
const fs = require('fs')
const commonJsRequire = /var ([$\w]+) = require\("(.*)"\)/g
const moduleExports = /module\.exports = \{(\n( ([$\w]+): ([$\w]+)(, )?\n)*)?\};/m
@kaosat-dev
kaosat-dev / esnextbin.md
Last active April 18, 2017 10:16
esnextbin sketch
@kaosat-dev
kaosat-dev / workerSpawner.js
Created April 12, 2017 16:30
jscad fake webworker
// ui-worker.js
//
// == OpenJSCAD.org, Copyright (c) 2013-2016, Licensed under MIT License
//
// History:
// 2016/02/02: 0.4.0: GUI refactored, functionality split up into more files, mostly done by Z3 Dev
// Create an worker (thread) for converting various formats to JSCAD
//
// See conversion-worker.js for the conversion process
@kaosat-dev
kaosat-dev / index.js
Last active April 4, 2017 12:13
Partial.lenses: flat list to scene graph & vice versa
import * as L from "partial.lenses"
import * as R from "ramda"
/*
- uu85
- uu00
- uu10
- uu530
- uu6320
*/
@kaosat-dev
kaosat-dev / clone-all-twitter-github-repos.sh
Created March 29, 2017 10:09 — forked from caniszczyk/clone-all-twitter-github-repos.sh
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@kaosat-dev
kaosat-dev / index.js
Created March 28, 2017 08:14
Regl-Test
/*
tags: basic, lighting
<p>This example shows how you can apply multiple light sources to a model</p>
*/
const regl = require('regl')()
const normals = require('angle-normals')
const mat4 = require('gl-mat4')
const bunny = require('bunny')
@kaosat-dev
kaosat-dev / index.js
Created March 16, 2017 21:05
Cycle.js 'simplified' api for chaining http request (for example)
import { of } from 'most'
import { div } from 'foo'
import { makeSubject } from 'bar'
function main (sources) {
const request$ = makeSubject() // subject of requests, for all requests
// const {request$, response$} = makeRequest1(sources, 'http://localhost:8080/hello')
// const response$ = makeRequest2(sources, requests$, 'http://localhost:8080/hello')
const req = (url, opts) => makeRequest2(sources, request$, url, opts)
const response$ = req('http://my-api.com/hello')
@kaosat-dev
kaosat-dev / 0-Simple counter: different implementations...
Created March 14, 2017 14:33 — forked from srdjan/100+ different counter apps...
Simple counter: different implementations...
different implementations of the simple counter app... code verbosity vs expressiveness
@kaosat-dev
kaosat-dev / first.js
Created March 13, 2017 15:57
partial.lenses experiment
import * as L from "partial.lenses"
import * as R from "ramda"
/*var sampleTitles = {
titles: [{ language: "en", text: "Title" },
{ language: "sv", text: "Rubrik" }]
}
const sampleTest = L.compose(
L.prop("titles"),