type StringBool = "true"|"false";
interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };
type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
#!/usr/bin/env node | |
var fs = require('fs'); | |
var join = require('path').join; | |
var EDC_HOME = process.env.EDC_HOME; | |
var seedPath = join(EDC_HOME, 'angular2-seed'); |
In my proposed lightning talk for the Reactive Conference, I'll create Conway's Game of Life in ClojureScript, and I'll do it in five minutes. I'll use an interactive programming workflow enabled by Figwheel. Each piece will be added into the running application without reloading the page.
If you want to see a little cellular lifeform spawn out of nothing into an running web browser window, I'd appreciate it if you starred this Gist!
Cheers,
(@teropa)
#!/usr/bin/env ruby | |
# (1) Prevent any commit to production branches | |
PRODUCTION_BRANCHES = ["production"] | |
branch = `git rev-parse --abbrev-ref=strict HEAD`.chomp | |
if (PRODUCTION_BRANCHES.include?(branch)) | |
puts "\nDo you really want to commit on '#{branch}' branch?\nIf yes, add --no-verify to the commit command to force it." |
In React's terminology, there are five core types that are important to distinguish:
React Elements
operator (<~) 49 | |
{ $channel } => #{ yield csp.take($channel) } | |
operator (~>) 50 right | |
{ $value, $channel } => #{ yield csp.put($channel, $value) } | |
macro (<~alts) { | |
rule { } => { | |
yield csp.alts | |
} |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
pygmentize -f rtf FILE | pbcopy
- Paste into TextEdit (in rich text mode: Format → Make Rich Text before pasting), and copy to clipboard again.
- In PowerPoint, Edit → Paste Special… → Styled Text.
(Pasting RTF directly into PowerPoint doesn't work correctly, at least with PowerPoint 2008 — it extends colour spans longer than it should, and sometimes removes line breaks. Going via TextEdit seems to solve the problem.)
"Sets nice colorscheme | |
colorscheme slate | |
"Starts the syntax | |
syntax on | |
"Sets smart indent | |
set smartindent | |
"Sets 4 spaces on tab | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab |
//------------------------------------------------------------- | |
// | |
// Hypothesis: | |
// | |
// Promises/A is a Monad | |
// | |
// To be a Monad, it must provide at least: | |
// - A unit (aka return or mreturn) operation that creates a corresponding | |
// monadic value from a non-monadic value. | |
// - A bind operation that applies a function to a monadic value |