Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html lang="en" style="height: 100%">
<head>
<meta charset="utf-8" />
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 100%"></div>
<script src="https://fastly.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://fastly.jsdelivr.net/npm/echarts@5.6.0/dist/echarts.min.js"></script>
<script src="https://unpkg.com/neo4j-driver"></script>
async function showGraph(fetchData) {
const dom = document.getElementById("container");
const chart = echarts.init(dom, null, {
renderer: "canvas",
useDirtyRect: false,
});
const app = {};
chart.showLoading();
const { data, links, categories } = await fetchData();
@leafOfTree
leafOfTree / ANSI.md
Created January 28, 2022 03:21 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@leafOfTree
leafOfTree / comment.md
Last active July 11, 2019 02:15
Spacemacs: show *scratch* on startup

Edit file ~/.emacs.d/core/core-spacemacs.el

Comment out the following lines:

(setq inhibit-startup-screen t)
(spacemacs-buffer/goto-buffer)

to

(setq inhibit-startup-screen nil)

@leafOfTree
leafOfTree / backend.js
Created October 15, 2018 11:35
PayPal restful APIs demo with React and node Express
import fetch from '../../core/fetch';
async function getAccessToken() {
// Sandbox api credentials
const clientID = 'ATQe34FLewSrenK0oYorF14KVYKIhXAJyQBxKzlWpzGattpmjSfFIWhFbBu0L1awF9qMq-xa_Pqyi1Wr';
const secret = 'EDOoVwFo6Dh-zdU76hbueubbjvCXroendoQCZUQr4ixlEWZQFvF9DMvWx1LeqskTpk8FXWOxVUfSwZ4Y';
const credential = Buffer
.from(`${clientID}:${secret}`)
.toString('base64');
@leafOfTree
leafOfTree / html.vim
Created May 25, 2018 03:18
vim html syntax for VueJS, AngularJS and Angular
""" VueJS directive syntax
syntax match VueJSAttr contained '\v<(\w*-)?v(-\w*)*(\=\"[^"]*\")?' contains=VueJSKey,VueJSValue,VueJSInject
syntax match VueJSKey contained '\v<(\w*-)?v(-\w*)*'
syntax match VueJSValue contains=VueJSInject contained '\v\"\zs[^"]*\ze\"'
syntax match VueJSInject contained '\v\$\w*'
hi link VueJSAttr Comment
hi link VueJSKey PreProc
hi link VueJSInject Constant
""" AngularJS directive syntax
@leafOfTree
leafOfTree / javascript.vim
Created May 18, 2018 04:21
start with '.' and not end with ';', indent as prev line
" start with '.' and not end with ';', indent as prev line
let l:prev_line = getline(v:lnum -1)
if l:prev_line =~ '^\s*\..*\(;\)\@<!$'
return -1
endif
@leafOfTree
leafOfTree / 0_reuse_code.js
Created February 29, 2016 03:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console