Skip to content

Instantly share code, notes, and snippets.

Less is more; more is less.

cybai CYBAI

View GitHub Profile
@emilio
emilio / reduce-css.js
Last active Mar 22, 2019
Ever wanted to reduce all the CSS in a test-case to the minimmum? :)
View reduce-css.js
var USELESS_PROPERTIES = [];
function processContainer(container) {
if (container instanceof CSSSupportsRule)
if (!CSS.supports(container.conditionText))
return false;
if (container instanceof CSSMediaRule)
if (!matchMedia(container.conditionText).matches)
return false;
if (container.media && container.media.mediaText)
@yelouafi
yelouafi / algebraic-effects-series-1.md
Last active Apr 20, 2019
Operational Introduction to Algebraic Effects and Continuations
View algebraic-effects-series-1.md

Algebraic Effects in JavaScript part 1 - continuations and control transfer

This is the first post of a series about Algebraic Effects and Handlers.

There are 2 ways to approach this topic:

  • Denotational: explain Algebraic Effects in terms of their meaning in mathematics/Category theory
  • Operational: explain the mechanic of Algebraic Effects by showing how they operate under a chosen runtime environment

Both approaches are valuables and give different insights on the topic. However, not everyone (including me), has the prerequisites to grasp the concepts of Category theory and Abstract Algebra. On the other hand, the operational approach is accessible to a much wider audience of programmers even if it doesn't provide the full picture.

@rayshih
rayshih / Main.purs
Created Sep 2, 2018
Typelevel N Queen in PureScript
View Main.purs
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (log)
import Data.Ord (abs)
import Data.List (List(Nil), range, (:), length)
import Data.Traversable (traverse)
@muan
muan / details-links.md
Last active Feb 28, 2019
Details on details cheatsheet.
View details-links.md
@weihanglo
weihanglo / rust-vs-go.md
Last active Apr 10, 2019
【譯】Rust vs. Go
View rust-vs-go.md

【譯】Rust vs. Go

本文譯自 Julio MerinoRust vs. Go。Julio Merino 目前是 G 社僱員,在 G 社工作超過 8 年,無論工作內外,都接觸開發不少 Go 語言,並撰寫 [Rust 點評][rust-review]系列文,來聽聽他對 Rust 與 Go 的想法吧。

Thanks Julio Merino for this awesome article!


View FLOLAC18.agda
-- programming
data Nat : Set where
zero : Nat
suc : Nat Nat
_+_ : Nat Nat Nat
zero + n = n
suc m + n = suc (m + n)
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active Apr 13, 2019
A Gentle Introduction to Prepack, Part 1
View prepack-gentle-intro-1.md

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
View pinafore_browser_bugs.md
@etienne-dldc
etienne-dldc / combineContext.js
Created Mar 28, 2018
A small function to combine react Contexts.
View combineContext.js
import React from 'react';
function onlyChild(children) {
return Array.isArray(children) ? children[0] : children;
}
export function combineContext(contexts) {
class Provider extends React.Component {
render() {
const init = this.props.children;
You can’t perform that action at this time.