Skip to content

Instantly share code, notes, and snippets.

View yeungon's full-sized avatar
💭
In JavaScript we trust

Vuong Nguyen yeungon

💭
In JavaScript we trust
View GitHub Profile
@yeungon
yeungon / vocabulary.py
Created September 2, 2021 16:19
Reading Vocabulary Lists by Grade Level
# Source: http://www.hpcsd.org/district.cfm?subpage=29208
grade1 = "annoy attention calm comfortable consequences curious curve decide directions discover disappointed embarrassed enormous exhausted explore fair fascinating feast focus gigantic grumpy huge ignore instead investigate invite important jealous leader list lovely frustrated leader listen measuring miserable mumble negative nervous nibbled note notice observing opposite ordinary positive precious prefer problem protect proud question reminds repeat report rhyme respect rhyme searching special spotless squirm stomped suddenly suggestion surprise uncomfortable warning wonder worried"
grade2 = "Amaze Amusing Analyze Annoy Arranged Avoid Cause Classify Community Conclusion Connection Continue Cooperation Curious Cycle Data Describe Detail Diagram Difference Different Discover Drowsy Edit Effect Energy Enormous Escape Estimate Exercise Expect Famous Flock Friendly Frighten Frown Gasp Gather Gust Helpful Include Insist Investigate Label Leaned Living M
@yeungon
yeungon / background.js
Created January 15, 2021 14:31 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@yeungon
yeungon / index.html
Created December 20, 2020 12:59 — forked from sk8terboi87/index.html
JavaScript Web Worker Example: Fetching Random Content from Wikipedia using Web Workers. http://codelikeapoem.com/2017/03/web-workers-beginners-guide.html
<!DOCTYPE html>
<html>
<head>
<title>Polling Example</title>
<style type="text/css">
.title, .result {
display: inline-block;
padding: 10px;
background-color: #fffeee;
}
#!/bin/bash
echo 'Hi there, this code will turn off the current ngixn and turn on XAMPP'
turnoff="sudo systemctl stop nginx"
#eval turnoff
eval $turnoff
@yeungon
yeungon / introrx.md
Created July 4, 2020 09:54 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@yeungon
yeungon / media-query.css
Created January 1, 2020 17:12 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@yeungon
yeungon / install.sh
Created September 24, 2019 10:37 — forked from planetoftheweb/install.sh
installation for Vue and Firebase single
npm i --save-dev @fortawesome/fontawesome-free @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/vue-fontawesome bootstrap jquery popper.js firebase vuefire
### Keybase proof
I hereby claim:
* I am yeungon on github.
* I am vuong (https://keybase.io/vuong) on keybase.
* I have a public key ASCBIKyysSZl_snIsyVwrL70ilFNqppqdcL3EPtoy21USQo
To claim this, I am signing this object:
@yeungon
yeungon / collect_form_data.js
Created June 5, 2019 03:44 — forked from everdimension/collect_form_data.js
A way to collect form data without `FormData` api.
handleSubmit(event) {
const form = event.target;
const data = {}
for (let element of form.elements) {
if (element.tagName === 'BUTTON') { continue; }
data[element.name] = element.value;
}
}
@yeungon
yeungon / PHP function for sending partial content
Created April 16, 2019 12:36
PHP function for sending partial content
<?php
function serveFilePartial($fileName, $fileTitle = null, $contentType = 'application/octet-stream')
{
if( !file_exists($fileName) )
throw New \Exception(sprintf('File not found: %s', $fileName));
if( !is_readable($fileName) )
throw New \Exception(sprintf('File not readable: %s', $fileName));