Skip to content

Instantly share code, notes, and snippets.

View shijiezhou1's full-sized avatar

Shijie Zhou shijiezhou1

View GitHub Profile
@shijiezhou1
shijiezhou1 / app.js
Created October 6, 2020 21:43
Vue3-todo
<template>
<h1>Vue 3 Todo App:</h1>
<Container />
</template>
<script>
import Container from './components/Container';
export default {
name: 'App',
@shijiezhou1
shijiezhou1 / Todo.vue
Created October 6, 2020 21:53
Vue3 Todo
<template>
<ul>
<li
v-for="(todolist, index) in TodoLists"
:key="index"
>
<span class="name">{{todolist.name}}</span>
<span
class="delete"
@click="Delete(todolist.id)"
@shijiezhou1
shijiezhou1 / javascript
Last active August 16, 2021 15:35
runSequentially function
// the function is to make sure the answer is correctly return
async function runSequentially(functions) {
const resolveLists = []
for (const fu of functions) {
resolveLists.push(await fu());
};
return resolveLists;
}
@shijiezhou1
shijiezhou1 / flatten-array-function.md
Last active August 19, 2021 08:33
Flatten Array Manually
let arr0 = [1, 3, 4, 5, [1]];
let arr1 = [1, 2, 3, [1, [2, { a: 3 }], 4, [2, 3, 4]]];

function flatten(input) {
    const stack = [...input];

    const res = [];
    let i = 0;
 while (stack.length) {
@shijiezhou1
shijiezhou1 / calculator.js
Last active November 7, 2021 06:25
calculator.js
var calculate = function (s) {
const stackData = lexer(s);
// console.log({stackData});
return run(stackData);
};
function run(stack) {
let pos = 0;
@shijiezhou1
shijiezhou1 / container.js
Last active January 10, 2022 01:27
Vue3 Todo
<template>
<div class="container">
<input
type="text"
v-model="msg"
>
<button @click="Create">Create</button>
<TodoList
:TodoLists="TodoLists"
:Delete="Delete"
@shijiezhou1
shijiezhou1 / script.sh
Created March 15, 2022 08:13
Moving all file with same extension in mac terminal
find ~/Desktop/xxx/ -name "*.ext" -exec mv -i {} -t ~/Desktop/xxx \;
@shijiezhou1
shijiezhou1 / re-assign.js
Created March 8, 2022 06:18
Reassign const value
Reassign const
const { type, title, description } = MAP[status];
({ type, description } = MAP[status]);
@shijiezhou1
shijiezhou1 / img_gist
Created December 15, 2022 03:53
img_gist
img_gist
@shijiezhou1
shijiezhou1 / ABOUTME.gif
Last active April 19, 2023 13:15
AboutMe
ABOUTME.gif