Skip to content

Instantly share code, notes, and snippets.

View EcutDavid's full-sized avatar
📚

David Guan EcutDavid

📚
View GitHub Profile
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Demo</title>
</head>
<body>
<script src="https://sdk.canva.com/designbutton/v2/api.js"></script>
<script>
Canva.DesignButton.initialize({
// Please replace the apiKey with yours :)
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Demo</title>
<style>
body {
padding-top: 50px;
text-align: center;
font-size: 2.5em;
}
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
padding-top: 50px;
text-align: center;
font-size: 2.5em;
}
Goal Result
Run 1300 KM in total #PhysicalStrength 691 KM
Practice boxing 1 hour per week #PhysicalStrength only a few weeks
Run Marathon once #PhysicalStrength
Practice music instrument 6 hours per week #Hobbies only a few weeks
Make 4 Youtube videos #Hobbies
Spend at least 10 hours every week on algorithms study & practice #Skills only 2 hours per week
Finish 3 online courses & writing a blog for each #Skills only 1 without blog produced
Keep getting out of the comfort zone #Work give myself a 50% ✅ mark
Read the source code of Chromium and writing some blogs on it #Work
const textFromInternet = 'In computer science, mathematics, management science, economics and bioinformatics, dynamic programming (also known as dynamic optimization) is a method for solving a complex problem by breaking it down into a collection of simpler subproblems, solving each of those subproblems just once, and storing their solutions. The next time the same subproblem occurs, instead of recomputing its solution, one simply looks up the previously computed solution, thereby saving computation time at the expense of (it is hoped) a modest expenditure in storage space. (Each of the subproblem solutions is indexed in some way, typically based on the values of its input parameters, so as to facilitate its lookup.) The technique of storing solutions to subproblems instead of recomputing them is called "memoization".';
const LINE_LENGTH = 90;
function calcBadness(line) {
const diff = LINE_LENGTH - line.length;
if (diff >= 0) {
return Math.pow((LINE_LENGTH - line.length), 2);
}
return Number.MAX_
@EcutDavid
EcutDavid / ui.js
Last active September 3, 2019 02:55
build-kite-stuff
// Retry the first time time-out
document.querySelectorAll('.build-details-pipeline-job-state-timed_out, .build-details-pipeline-job-state-failed').forEach(d => {
d.querySelector('i').click();
d.querySelector('a[href$=retry]').click();
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Voice Notes</title>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
/>
const path = require("path");
const AWS = require("aws-sdk");
const fs = require("fs");
const fsPromises = fs.promises;
const polly = new AWS.Polly();
const s3 = new AWS.S3();
const bucketName = "polly-voice-notes";
const notesDir = "notes";
const manifestFileKey = 'manifest.json';
const AWS = require("aws-sdk");
const polly = new AWS.Polly();
const bucketName = "polly-voice-notes";
const pollyCommonParas = {
OutputFormat: "mp3",
VoiceId: "Matthew",
OutputS3BucketName: bucketName
};
// Parsing a graph from the input, then, dfs to walk through the map.
package main
import (
"fmt"
)
var (
braceOpenASC = "("[0]
braceCloseASC = ")"[0]