Skip to content

Instantly share code, notes, and snippets.

Avatar

Shijie Zhou shijiezhou1

View GitHub Profile
@shijiezhou1
shijiezhou1 / script.sh
Created Mar 15, 2022
Moving all file with same extension in mac terminal
View script.sh
find ~/Desktop/xxx/ -name "*.ext" -exec mv -i {} -t ~/Desktop/xxx \;
@shijiezhou1
shijiezhou1 / re-assign.js
Created Mar 8, 2022
Reassign const value
View re-assign.js
Reassign const
const { type, title, description } = MAP[status];
({ type, description } = MAP[status]);
View calculator.js
var calculate = function (s) {
const stackData = lexer(s);
// console.log({stackData});
return run(stackData);
};
function run(stack) {
let pos = 0;
View flatten-array-function.md
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 / javascript
Last active Aug 16, 2021
runSequentially function
View javascript
// 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;
}
View Todo.vue
<template>
<ul>
<li
v-for="(todolist, index) in TodoLists"
:key="index"
>
<span class="name">{{todolist.name}}</span>
<span
class="delete"
@click="Delete(todolist.id)"
View container.js
<template>
<div class="container">
<input
type="text"
v-model="msg"
>
<button @click="Create">Create</button>
<TodoList
:TodoLists="TodoLists"
:Delete="Delete"
View app.js
<template>
<h1>Vue 3 Todo App:</h1>
<Container />
</template>
<script>
import Container from './components/Container';
export default {
name: 'App',
@shijiezhou1
shijiezhou1 / wp_ssl.conf
Created Jul 5, 2020
WordPress Https Conf File
View wp_ssl.conf
server {
listen 443 ssl;
server_name www.example.com example.com; # change example to your domain
ssl_certificate /etc/nginx/conf.d/certification/wp.pem;
ssl_certificate_key /etc/nginx/conf.d/certification/wp.key;
location / {
proxy_pass http://{your-cloud-ip}:8080;
}
@shijiezhou1
shijiezhou1 / docker-compose.yml
Created Jul 5, 2020
Oracle with WordPress Docker compose
View docker-compose.yml
version: '3.7'
services:
wordpress:
image: wordpress
container_name: wp
restart: always
ports:
- 8080:80