Skip to content

Instantly share code, notes, and snippets.

View erickzhao's full-sized avatar
:atom:
:hurtrealbad: :goberserk: :finnadie:

Erick Zhao erickzhao

:atom:
:hurtrealbad: :goberserk: :finnadie:
View GitHub Profile
@erickzhao
erickzhao / index.js
Last active October 1, 2017 17:17
requirebin sketch
let CSVExportService = require('json2csvexporter').default;
const exporter = CSVExportService.create();
function download(htmlTable) {
exporter.downloadCSV(tableToJson(htmlTable));
}
// Credits: http://johndyer.name/html-table-to-json/
function tableToJson(table) {
@erickzhao
erickzhao / vhdl-sux.js
Created March 12, 2018 23:37
Convert decimal numbers to Two's Complement binary representation.
const fs = require('fs');
const dec2bin = (dec) => {
return (dec >>> 0).toString(2);
}
fs.readFile('lab2-x.txt', 'utf8', (err,data) => {
// split text into numbers
const a = data.split(' ');
@erickzhao
erickzhao / INSTRUCTIONS.md
Created July 21, 2018 04:33
Git remote static site deployment on Gastly 👻

1

@erickzhao
erickzhao / POWERHOUR.js
Last active July 31, 2020 01:48
Power Hour Runner
const buttons = {
next: document.querySelector('[title="Next"]'),
play: document.querySelector('[title="Play"]'),
}
// CONFIGURATION CONSTANTS
const HORN_LINK = 'https://raw.githubusercontent.com/bread-gang/SAAS/master/airhorn.mp3'; // change horn sound
const SONG_TIME = 60000; // in ms
const NUM_SONGS = 60; // change number of songs played
const NUM_END_SONGS = 1; // number of songs to play in full at the end
@erickzhao
erickzhao / index.html
Created January 23, 2020 19:50
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
@erickzhao
erickzhao / index.html
Created March 20, 2020 21:42
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<button id="save">Save File</button>
@erickzhao
erickzhao / index.html
Created March 30, 2020 23:38
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
@erickzhao
erickzhao / index.html
Created March 31, 2020 23:53
Electron Fiddle Gist
<!-- Empty -->
@erickzhao
erickzhao / index.html
Created April 2, 2020 17:25
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<link rel="stylesheet" type="text/css" href="./styles.css">
</head>
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->