Skip to content

Instantly share code, notes, and snippets.

Avatar
💭

David Guan EcutDavid

💭
View GitHub Profile
View medium-canva-JavaScript-SDK-demo-3.html
<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;
}
View medium-canva-JavaScript-SDK-demo-2.html
<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;
}
View medium-canva-JavaScript-SDK-demo-1.html
<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 :)
View 2019_goals.csv
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
View medium-voice-notes-p1-demo.html
<!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"
/>
View medium-voice-notes-p1-build-script.js
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';
View medium-voice-notes-p1-polly.js
const AWS = require("aws-sdk");
const polly = new AWS.Polly();
const bucketName = "polly-voice-notes";
const pollyCommonParas = {
OutputFormat: "mp3",
VoiceId: "Matthew",
OutputS3BucketName: bucketName
};
@EcutDavid
EcutDavid / ui.js
Last active Sep 3, 2019
build-kite-stuff
View ui.js
// 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();
});
View medium-aoc-2018-day-20.go
// Parsing a graph from the input, then, dfs to walk through the map.
package main
import (
"fmt"
)
var (
braceOpenASC = "("[0]
braceCloseASC = ")"[0]
@EcutDavid
EcutDavid / bookmark.js
Last active Nov 9, 2018
Download Codeforces test cases
View bookmark.js
var inputs = document.querySelectorAll(".input pre");
for (var i = 0; i < inputs.length; i++) {
var s = inputs[i].innerHTML;
s = s.replace(/<br>/g, "\n");
console.log(s)
// decode html entities
var div = document.createElement("div");
div.innerHTML = s;