Skip to content

Instantly share code, notes, and snippets.

@musicq
musicq / main.rs
Created December 8, 2023 04:41 — forked from lu4nm3/main.rs
Tokio Async: Concurrent vs Parallel
use futures::StreamExt;
use std::error::Error;
use tokio;
use tokio::macros::support::Pin;
use tokio::prelude::*;
use tokio::time::{Duration, Instant};
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut multi_threaded_runtime = tokio::runtime::Builder::new()
.threaded_scheduler()
@musicq
musicq / change-author.sh
Last active October 30, 2023 08:11
Change git log history author
#!/bin/sh
# Prompt the user for input
read -p "Enter OLD_EMAIL: " OLD_EMAIL
read -p "Enter CORRECT_NAME: " CORRECT_NAME
read -p "Enter CORRECT_EMAIL: " CORRECT_EMAIL
# Run git filter-branch with user input
git filter-branch -f --env-filter "
OLD_EMAIL=\"$OLD_EMAIL\"
/**
* Given a DOM data structure in JSON
* write a function that can render JSON DOM
* onto an existing DOM node
* It is totally acceptable to google for javascript or dom
* manipulation related functions
*/
const vDom = {
name: "form",
tag: "form",
@musicq
musicq / .gitconfig
Created December 10, 2020 07:03
Git global configure
[user]
name = musicq
email = liang.kui@hotmail.com
[pull]
rebase = true
[alias]
co = checkout
s = status -s
a = add
c = commit
@musicq
musicq / binary-array.js
Created February 22, 2020 18:04
Declare a binary array
let binaryArray = new Array(5).fill(new Array(10));
// or maybe more dimension
let arr = new Array(5).fill(new Array(10).fill(new Array(15)));
@musicq
musicq / cloudSettings
Last active March 26, 2020 06:45
Build store manager using rxjs
{"lastUpload":"2020-03-26T06:45:06.530Z","extensionVersion":"v3.4.3"}
@musicq
musicq / .vim.bundles
Created March 27, 2019 01:42
Vim Config
" vundle 环境设置
filetype off
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#begin()
" Define bundles via github repos
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
@musicq
musicq / install.sh
Last active April 16, 2019 01:59
J-CLI Manager
#!/usr/bin/env bash
command=$1
registry="https://registry-npm.yunzhanghu.net"
if [ ! ${command} ]; then
command="install"
fi
@musicq
musicq / RxJS 5 Operators By Example.md
Created May 22, 2017 04:12 — forked from lyyourc/RxJS 5 Operators By Example.md
「译」RxJS 5 Operators By Example