On Mac, if you have Homebrew installed, run:
> brew install highlight
Add to your shell config or .aliases file:
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Bible Verse Example (React.js)</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css" /> |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>JavaScript Testing Playground</title> | |
| <link href="https://cdnjs.cloudflare.com/ajax/libs/mocha/2.2.5/mocha.min.css" rel="stylesheet" /> | |
| <style> | |
| *, *:before, *:after { |
| [alias] | |
| br = branch | |
| co = checkout | |
| pr = pull --rebase | |
| st = status | |
| vimdiff = difftool -y -t vimdiff | |
| lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
| graph = log --branches --pretty=short --decorate --graph | |
| branch-name = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD` | |
| dag = log --graph --format='format:%C(yellow)%h%C(reset) %C(blue)\"%an\" <%ae>%C(reset) %C(magenta)%cr%C(reset)%C(auto)%d%C(reset)%n%s' --date-order |
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
| brew install -v apparix | |
| # Installed to: /opt/foo/Cellar/apparix/11-0/bin/apparix | |
| # Add bm/to Bash functions from man page to .bashrc or .local.bash: | |
| man -P cat apparix | awk '/BASH-style functions/{p=1} /---/{if(p==1)p=2; else p=0; next} p>1{print}' >> ~/.bash_profile | |
| # Reload my bash config: | |
| source ~/.bash_profile | |
| # Now create a bookmark: |
| // Place your settings in this file to overwrite the default settings | |
| { | |
| "editor.acceptSuggestionOnEnter": "off", | |
| "editor.minimap.enabled": true, | |
| "eslint.options": { | |
| "configFile": "eslintrc.js" | |
| }, | |
| "files.insertFinalNewline": true, | |
| "files.trimTrailingWhitespace": true, | |
| "flow.pathToFlow": "/usr/local/bin/flow", |
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Multiply</title> | |
| <meta charset="utf-8"> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.4.2/mocha.css"> | |
| </head> | |
| <body> |
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Add Classes (without using classList or jQuery)</title> | |
| <meta charset="utf-8"> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/3.4.2/mocha.css"> | |
| </head> | |
| <body> |
| // Example Babel 7 config | |
| // Server-Side Preact Rendering | |
| // with esm (most of the time) | |
| // but Babel handles modules in test | |
| // so Jest works | |
| // target node version for Babel transpilation | |
| const NODE_TARGET = 9; | |
| // default settings for preset-env |