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) {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img_gist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ~/Desktop/xxx/ -name "*.ext" -exec mv -i {} -t ~/Desktop/xxx \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reassign const | |
const { type, title, description } = MAP[status]; | |
({ type, description } = MAP[status]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var calculate = function (s) { | |
const stackData = lexer(s); | |
// console.log({stackData}); | |
return run(stackData); | |
}; | |
function run(stack) { | |
let pos = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<ul> | |
<li | |
v-for="(todolist, index) in TodoLists" | |
:key="index" | |
> | |
<span class="name">{{todolist.name}}</span> | |
<span | |
class="delete" | |
@click="Delete(todolist.id)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="container"> | |
<input | |
type="text" | |
v-model="msg" | |
> | |
<button @click="Create">Create</button> | |
<TodoList | |
:TodoLists="TodoLists" | |
:Delete="Delete" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<h1>Vue 3 Todo App:</h1> | |
<Container /> | |
</template> | |
<script> | |
import Container from './components/Container'; | |
export default { | |
name: 'App', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
NewerOlder