Skip to content

Instantly share code, notes, and snippets.

View chenyong's full-sized avatar
💭
Debugging TypeScript...

ChenYong chenyong

💭
Debugging TypeScript...
  • NIO
  • Shanghai
View GitHub Profile
@chenyong
chenyong / etlas.log
Created February 1, 2018 05:54
etlas update -v3
no user package environment file found at /Users/chen/repo/memkits/copycat
Downloading the latest package lists from:
- hackage.haskell.org
- etlas.typelead.com
Searching for curl in path.
Found curl at /usr/bin/curl
Searching for powershell in path.
Cannot find powershell on the path
Searching for wget in path.
Found wget at /usr/local/bin/wget
@chenyong
chenyong / error.log
Created February 12, 2018 15:31
=>> cat target/shadow-cljs/logging.properties
=>> yarn watch
yarn run v1.3.2
$ shadow-cljs watch browser
shadow-cljs - config: /Users/chen/repo/mvc-works/calcit-workflow/shadow-cljs.edn version: 2.1.6
shadow-cljs - starting ...
Can't load log handler "java.util.logging.FileHandler"
java.nio.file.NoSuchFileException: /Users/chen/repo/mvc-works/coworkflow/target/shadow-cljs/shadow-cljs.log.0.lck
java.nio.file.NoSuchFileException: /Users/chen/repo/mvc-works/coworkflow/target/shadow-cljs/shadow-cljs.log.0.lck
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
@chenyong
chenyong / rotate.js
Created April 9, 2018 09:11
Some math to explore 3D rotation, find the center point of the orbit.
axie = k1 * (x*i + y*j + z*k)
point = a*i + b*j + c*k
distance = (k1*x - a)*i + (k1*y - b)*j + (k1*z - c)*k
0 = axie * distance = k1 * (x*i + y*j + z*k) * ((k1*x - a)*i + (k1*y - b)*i + (k1*z - c)k)
0 = (x*i + y*j + z*k) * ((k1*x - a)*i + (k1*y - b)*i + (k1*z - c)k)
= (x*i) * ((k1*x - a)*i + (k1*y - b)*j + (k1*z - c)k)
@chenyong
chenyong / shadow-cljs.log
Last active April 11, 2018 04:28
Some experience using JS dependencies in shadow-cljs.
[:browser] Compiling ...
[:browser] Build completed. (138 files, 1 compiled, 0 warnings, 0.20s)
[:browser] Compiling ...
[:browser] Build completed. (138 files, 1 compiled, 0 warnings, 0.22s)
[:browser] Compiling ...
[:browser] Build completed. (138 files, 1 compiled, 0 warnings, 0.24s)
[:browser] Compiling ...
[:browser] Build completed. (138 files, 1 compiled, 0 warnings, 0.20s)
[:browser] Compiling ...
[:browser] Build failure:
@chenyong
chenyong / main.ts
Created June 28, 2018 03:42
An url parser
let pageRules = [
{
name: "a",
path: "reports/:reportId/edit",
router: [],
},
{
name: "b",
path: "reports/:reportId",
router: [],
@chenyong
chenyong / keybindings.json
Last active November 7, 2018 10:30
VS Code settings
// Place your key bindings in this file to overwrite the defaults
[{
"key": "ctrl+tab",
"command": "workbench.action.nextEditor"
},
{
"key": "ctrl+shift+tab",
"command": "workbench.action.previousEditor"
},
{
@chenyong
chenyong / pom.xml
Created September 11, 2018 03:42
Working pom file for inflow-popup
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>respo</groupId>
<artifactId>inflow-popup</artifactId>
<version>0.2.3</version>
<name>inflow-popup</name>
<dependencies>
<dependency>
<groupId>org.clojure</groupId>
@chenyong
chenyong / meyvn-pom.xml
Created September 13, 2018 04:49
pom.xml generated by meyvn
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>respo</groupId>
<artifactId>inflow-popup</artifactId>
<version>0.2.5</version>
<name>inflow-popup</name>
<scm>
<connection>scm:git:[email protected]:Respo/inflow-popup.git</connection>
@chenyong
chenyong / immerState.ts
Last active October 17, 2018 06:17
ImmerState function with types
import React from "react";
import produce from "immer";
// get type of partial of an object with type T
export type IPartialObject<T> = { [K in keyof T]?: T[K] };
export interface ImmerStateFunc<S> {
(f: IPartialObject<S> | ((s: S) => void), callback?: () => void): void;
}