(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.
function createObservable(subscribe) { | |
return { | |
subscribe, | |
pipe: function(operator) { | |
return operator(this); | |
}, | |
}; | |
} | |
const numberObservable = createObservable(function(observer) { |
'use strict'; | |
import {Router5, RouteNode} from 'router5'; | |
import logger from '../logger'; | |
// The set of valid sink functions includes synchronous state-affecting router functions that do not require a callback | |
// and which do not have a significant return value other than the router object itself. | |
const validSinkFuncs = ['add','addNode','canActivate','deregisterComponent','navigate','registerComponent','setOption','start','stop']; | |
function validateAndRemapSinkArgument(arg) { |
const Cycle = require('@cycle/core'); | |
const CycleWeb = require('@cycle/web'); | |
const makeHTTPDriver = require('@cycle/http'); | |
const h = CycleWeb.h; | |
function main(responses) { | |
const GITHUB_SEARCH_API = 'https://api.github.com/search/repositories?q='; | |
// This essentially models when search requests are supposed | |
// to happen |
import kotlin.browser.document | |
import kotlin.browser.window | |
// Type definitions | |
native("Cycle") | |
val Cycle : dynamic = noImpl | |
native("Cycle.h") | |
fun h(tagName: String) : VTree = noImpl |
import Cycle from 'cyclejs'; | |
const { h, Rx } = Cycle; | |
// all html/svg element names << | |
var elements = [ | |
'a', | |
'abbr', | |
'address', | |
'area', |
var Q = require('q'); | |
function delaydo(x) { | |
var deferred = Q.defer(); | |
setTimeout(function() { | |
if (x === 2) { | |
console.log("reject: "+x); | |
deferred.reject(x); | |
} | |
else { |
A useful list of programming jargon to solve your naming problems.
Adapter: a design pattern that translates one interface for a class into a compatible interface.
Admin: short for 'administrator'; very commonly used in speech or online to refer to the systems person in charge on a computer. Common constructions on this include sysadmin and site admin (emphasizing the administrator's role as a site contact for email and news).
Counter: a variable or user interface that counts occurrences or repetitions of some phenomena or event.
[alias] | |
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative | |
lg2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit | |
lg = !"git lg1" |
import os | |
ENV_VARS_FILENAME = '.env' | |
def import_env_vars(project_root): | |
"""Imports some environment variables from a special .env file in the | |
project root directory. | |
""" | |
if len(project_root) > 0 and project_root[-1] != '/': |