(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #include <Adafruit_NeoPixel.h> | |
| #include <TM1637Display.h> | |
| #include <ThreeWire.h> | |
| #include <RtcDS1302.h> | |
| #include <RtcDateTime.h> | |
| #include <math.h> | |
| #define NEOPIXEL_PIN 11 | |
| #define NEOPIXLE_PIXELCOUNT 60 |
| {-# START_FILE package.yaml #-} | |
| spec-version: 0.31.0 | |
| name: {{name}} | |
| version: 0.1.0.0 | |
| # synopsis: | |
| # description: | |
| category: {{category}}{{^category}}Web{{/category}} | |
| homepage: https://github.com/{{github-username}}{{^github-username}}githubuser{{/github-username}}/{{name}}#readme | |
| bug-reports: https://github.com/{{github-username}}{{^github-username}}githubuser{{/github-username}}/{{name}}/issues | |
| author: {{author-name}}{{^author-name}}Author name here{{/author-name}} |
| # First, you must get the previous commit sha, the one before the forced push: | |
| ## Hit through terminal | |
| curl -u <username> https://api.github.com/repos/:owner/:repo/events | |
| # Then you can create a branch from this sha: | |
| ## Hit through terminal | |
| curl -u <github-username> -X POST -d '{"ref":"refs/heads/<new-branch-name>", "sha":"<sha-from-step-1>"}' https://api.github.com/repos/:owner/:repo/git/refs |
| /** If you want to know how to encoding HKTs in typescript, check this: | |
| https://gist.github.com/ENvironmentSet/1662a140f99381bc85fd6be51ecdcbb5 | |
| Sorry for messy names, this was only PoC. **/ | |
| export interface HKT { | |
| param: unknown; | |
| result: unknown; | |
| } |
| export interface HKT { | |
| param: unknown; | |
| result: unknown; | |
| } | |
| interface NotHKT extends HKT { | |
| result: this['param'] extends true ? false : true; | |
| } | |
| interface FstHKT extends HKT { |
| type Any = <B>(f: <A>(a: A) => B) => B; // Instead of forall a. a, use it's continuation. (they're isomorphic) | |
| function any<A>(a: A): Any { | |
| return f => f(a); | |
| } |
| // Sorry for poor naming, this example was intented to explain how to use skolem capturing in practise. | |
| interface Stateful<S, A> { | |
| (state: S): [A, S] | |
| } | |
| function fmap<S, A, B>(f: (a: A) => B): (stateful: Stateful<S, A>) => Stateful<S, B> { | |
| return stateful => state => { | |
| const [a, nextState] = stateful(state); |
| /** | |
| data List a = Nil | Cons a (List a) | |
| class Monoid a where | |
| mempty :: a | |
| mappend :: a -> a -> a | |
| instance Monoid (List a) where | |
| mempty = Nil | |
| mappend Nil ys = ys |
Andrea Simone Costa의 글을 보고 작성한 글 입니다(Andrea의 설명은 읽지 않고 쓰는 글이라 원문과 다르게 설명했을 확률이 높습니다).
spread properties의 문법적, 의미적인 성질을 이용하면 다음과 같이 깔끔하게 조건부로 객체의 프로퍼티를 선언할 수 있습니다.
const condition = true;
const foo = {