Skip to content

Instantly share code, notes, and snippets.

View liviaerxin's full-sized avatar

Frank liviaerxin

  • ASTRI
  • Hong Kong
View GitHub Profile
@liviaerxin
liviaerxin / 1 - Intro---README.md
Last active April 16, 2022 17:29 — forked from lostintangent/1 - Intro---README.md
Learning MobX (Side-Effects)

1: Intro

Welcome to the interactive tutorial on how to use side-effect "operators" in MobX! Over the course of the next three samples, you'll learn (and be able to explore) exactly how autorun, when and reaction work, and when/why you would use them when building reactive applications.

1: Intro

Welcome to the interactive tutorial on how to use side-effect "operators" in MobX! Over the course of the next three samples, you'll learn (and be able to explore) exactly how autorun, when and reaction work, and when/why you would use them when building reactive applications.

{
"scripts": [
"react",
"react-dom"
],
"styles": [
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.css"
]
}
@liviaerxin
liviaerxin / App.jsx
Last active April 16, 2022 13:27
react-todo
import React from "react";
// import React from 'react';
const REACT_VERSION = React.version;
function Todo({ todo, index, markTodo, removeTodo }) {
return (
<div className="todo">
<span style={{ textDecoration: todo.isDone ? "line-through" : "" }}>
{todo.text} - {todo.type}
@liviaerxin
liviaerxin / network_diagnosis.md
Last active March 8, 2023 06:51
Linux Network Diagnosis #network
@liviaerxin
liviaerxin / calculate.awk
Created December 18, 2021 09:37
Get the Min, Max, Median, and Mean of a Dataset By awk
#!/usr/bin/env awk -f
# Get the Min, Max, Median, and Mean of a Dataset
NR==1 { max=$1; min=$1 }
{
sum += $1
sumsq += ($1)^2
$1 < min ? min = $1 : 0
$1 > max ? max = $1 : 0
}
END {
@liviaerxin
liviaerxin / npm_mirror.md
Last active August 15, 2021 14:15
npm mirror setting #npm

npm and yarn mirror

mirror priority:

Project .npmrc > Global .npmrc > Default mirror source Project .yarnrc > Global .yarnrc > Default mirror source

npm mirror

  1. Restore to default repository
@liviaerxin
liviaerxin / python_build_tools.md
Created July 19, 2021 10:33
Python build tools introduction #python

Python Build Tools

In modern Python package project, it often includes such files:

  • pyproject.toml
  • setup.cfg
  • setup.py
  • MANIFEST.in

What's the relations among them and the purpose from them?

@liviaerxin
liviaerxin / python_setuptools_build_extensions.md
Last active March 8, 2023 06:49
Use setuptools to build extensions #python

Why I Write This?

Some day, I was building plyvel in macOS(Apple Silicon). plyvel is the interface to LevelDB and build a Python Extension for using the leveldb C++ library. In that building process, I found:

❯ python setup.py build_ext -i -n
running build_ext
skipping 'src/plyvel/_plyvel.cpp' Cython extension (up-to-date)
building 'plyvel._plyvel' extension
creating build
@liviaerxin
liviaerxin / gist:c24bb7b72f76c1069e00fd131322842d
Created June 20, 2021 11:45 — forked from jagregory/gist:710671
How to move to a fork after cloning #Git
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git