- Support Standard Markdown / CommonMark and GFM(GitHub Flavored Markdown);
- Full-featured: Real-time Preview, Image (cross-domain) upload, Preformatted text/Code blocks/Tables insert, Code fold, Search replace, Read only, Themes, Multi-languages, L18n, HTML entities, Code syntax highlighting...;
- Markdown Extras : Support ToC (Table of Contents), Emoji, Task lists, @Links...;
- Compatible with all major browsers (IE8+), compatible Zepto.js and iPad;
- Support identification, interpretation, fliter of the HTML tags;
- Support TeX (LaTeX expressions, Based on KaTeX), Flowchart and Sequence Diagram of Markdown extended syntax;
- Support AMD/CMD (Require.js & Sea.js) Module Loader, and Custom/define editor plugins;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create our server | |
| var server; | |
| server = http.createServer(function(req,res){ | |
| // Set CORS headers | |
| res.setHeader('Access-Control-Allow-Origin', '*'); | |
| res.setHeader('Access-Control-Request-Method', '*'); | |
| res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET'); | |
| res.setHeader('Access-Control-Allow-Headers', '*'); | |
| if ( req.method === 'OPTIONS' ) { | |
| res.writeHead(200); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Redis = require('ioredis'); | |
| var redis = new Redis({ | |
| host: "nodesydney.wiftycloud.com", | |
| password: "7884b8baaa49fbcb48f17ad2a146" | |
| }); | |
| async function main() { | |
| // write an event to stream 'events', setting 'key1' to 'value1' | |
| await redis.sendCommand( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Content-Security-Policy</title> | |
| <meta name="viewport" content="width=device-width"> | |
| <meta http-equiv="Content-Security-Policy" | |
| content="default-src 'self' data: gap: 'unsafe-eval' ws: ; | |
| style-src 'self' 'unsafe-inline'; | |
| script-src https: *.example.com ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "project-name", | |
| "description": "Template for static sites", | |
| "version": "1.0.0", | |
| "homepage": "http://www.project-name.com", | |
| "author": { | |
| "name": "Adam Reis", | |
| "url": "http://adam.reis.nz" | |
| }, | |
| "license": "UNLICENSED", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| NOTES: | |
| - source: https://github.com/thi-ng/umbrella/blob/develop/examples/hdom-local-render/src/index.ts | |
| - demo: https://demo.thi.ng/umbrella/hdom-local-render/ | |
| - docs on lifecycle: https://github.com/thi-ng/umbrella/tree/master/packages/hdom#component-objects-with-life-cycle-methods | |
| - docs on state MGMT/HOF components: https://github.com/thi-ng/umbrella/wiki/Higher-order-components | |
| */ | |
| import { DEFAULT_IMPL, normalizeTree, replaceChild } from "@thi.ng/hdom"; | |
| import { memoize1 } from "@thi.ng/memoize"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clear=cls | |
| grep=grep -nRi $* | |
| ga=git add -A $* | |
| gac=git add -A :/ $T git commit -e | |
| gacm=git add -A :/ $T git commit -m $* | |
| gau=git add -u | |
| gb=git branch -v $* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Lack of tail call optimization in JS | |
| var sum = function(x, y) { | |
| return y > 0 ? sum(x + 1, y - 1) : | |
| y < 0 ? sum(x - 1, y + 1) : | |
| x | |
| } | |
| sum(20, 100000) // => RangeError: Maximum call stack size exceeded | |
| // Using workaround |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html lang="en"> | |
| <body> | |
| <span id="output"></span> | |
| </body> | |
| <script> | |
| (function () { | |
| var workerBlob = new Blob( | |
| [workerRunner.toString().replace(/^function .+\{?|\}$/g, '')], | |
| { type:'text/javascript' } |