A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
import * as React from 'react'; | |
import * as unified from 'unified'; | |
import { useContext } from 'react'; | |
import classNames from '../libs/classNames'; | |
import mentions from './remark-mentions'; | |
import { StateContext } from '..'; | |
import { traverseMentions } from '../traverse-mentions'; | |
import { User } from '../types'; |
;;; initfile --- Summary: | |
;;; Commentary: | |
;; Emacs 25.1 and newer tested | |
;;; Code: | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Configuration/Customization: | |
;; Defines global variables that are later used to customize and set | |
;; up packages. | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
#!/usr/bin/env python3 | |
from functools import wraps | |
import json | |
# Pretend this was logging to disk | |
log = [] | |
def mutator(fn): |
A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
#!/usr/bin/env bash | |
# Install Xcode Command Line Tools. | |
xcode-select --install | |
# Install Homebrew. | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Install brew basics (auto-updating). | |
brew install terminal-notifier |
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income | |
FOR EACH ROW EXECUTE PROCEDURE notify_trigger( | |
'id', | |
'email', | |
'username' | |
); | |
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income | |
FOR EACH ROW EXECUTE PROCEDURE notify_trigger( | |
'id', |
function createStore (reducers) { | |
var state = reducers() | |
const store = { | |
dispatch: (action) => { | |
state = reducers(state, action) | |
}, | |
getState: () => { | |
return state | |
} | |
} |
Today, single page web apps are driving many websites that we use each and every day. Instead of having your browser request a new web page for each and every action you perform on a web page, single page web apps may load all in one request to smoothly and quickly transition with every action you perform.
When building single page web apps, you may decide to retrieve all of the HTML, CSS and Javascript with one single page load or dynamically load these resources as the user moves about your site. Either way, it can be a pain to bundle all of these assets together for the end user to download from your web server. This is where webpack comes into play.
webpack does all of the heavy lifting bundling all of your HTML, CSS and Javascript together. If you write your site all from scratch or depend on dependencies from npm, webpack takes care of packaging it all together for you. It has the ability to take your single page web app, cut out all of the code you don't need, then packa
Elm is a statically typed functional language that compiles to JavaScript. It's well-known for its developer experience: the compiler provides nice error messages, the package system enforces semantic versioning for all published packages and makes sure every exposed value or type has some documentation and type annotations.
Principles of Adult Behavior