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 / docker_wordpress.md
Created August 2, 2023 16:43 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@yeungon
yeungon / all-vietnamese-syllables.txt
Created May 4, 2022 14:59 — forked from hieuthi/all-vietnamese-syllables.txt
All possibly existent Vietnamese syllables, created by combine all onsets with all rimes. More information can be found at: http://hieuthi.com/blog/2017/03/21/all-vietnamese-syllables.html
a
ai
am
an
ang
anh
ao
au
ay
ba
@yeungon
yeungon / slug.js
Created April 4, 2022 10:59 — forked from bluzky/slug.js
Remove vietnamese accent javascript / Bỏ dấu tiếng Việt
function stringToSlug(str) {
// remove accents
var from = "àáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîöüûñçýỳỹỵỷ",
to = "aaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiouuncyyyyy";
for (var i=0, l=from.length ; i < l ; i++) {
str = str.replace(RegExp(from[i], "gi"), to[i]);
}
str = str.toLowerCase()
.trim()
@yeungon
yeungon / Dockerfile
Created January 7, 2022 14:28 — forked from nzvtrk/Dockerfile
Nest.js multi-stage build dockerfile + docker-compose with postgres & migrations
FROM node:12.14.1-alpine AS build
# If you have troubles with node-gyp use should install these dependencies
RUN apk add g++ make python
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . ./
# build js & remove devDependencies from node_modules
@yeungon
yeungon / Encryption.js
Created December 10, 2021 02:14 — forked from ve3/Encryption.js
Encrypt and decrypt between programming languages (PHP & JavaScript).
/**
* Encryption class for encrypt/decrypt that works between programming languages.
*
* @author Vee Winch.
* @link https://stackoverflow.com/questions/41222162/encrypt-in-php-openssl-and-decrypt-in-javascript-cryptojs Reference.
* @link https://github.com/brix/crypto-js/releases crypto-js.js can be download from here.
*/
class Encryption {
@yeungon
yeungon / webkit-pseudo-elements.md
Created November 28, 2021 12:03 — forked from leostratus/webkit-pseudo-elements.md
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@yeungon
yeungon / playAudioAsBlobViaAjax.js
Created November 26, 2021 08:10 — forked from praveenpuglia/playAudioAsBlobViaAjax.js
Download Audio from AJAX and Play as Blob
var a = fetch("http://path/to/audio.wav")
.then(res => {
var reader = res.body.getReader();
return reader.read().then(result => {
return result;
});
})
.then(data => {
console.log(data);
@yeungon
yeungon / gist:f83b9898794391478259ae3b436a5baa
Created October 5, 2021 05:05 — forked from nemesisqp/gist:8d47707f3de009b5df07d44052407c0a
3000 từ hán việt phổ biến (1 từ có thể có nhiều nghĩa khác nhau)
THIÊN: Trời
ĐỊA: Đất
CỬ: Cất
TỒN: Còn
TỬ: Con
TÔN: Cháu
LỤC: Sáu
TAM: Ba
GIA: Nhà
QUỐC: Nước
@yeungon
yeungon / vocabulary.py
Created September 2, 2021 16:19 — forked from kevinschaich/vocabulary.py
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'
});
});