Skip to content

Instantly share code, notes, and snippets.

Avatar
🍰

An Pham ancs21

🍰
  • Software Engineer
  • 0xF0 0x9F 0x8C 0x8F
View GitHub Profile
@ancs21
ancs21 / README.md
Created Sep 4, 2021
Find and delete node_modules folder tips
View README.md

Typed name:node_modules type:(file folder) into the search box

@ancs21
ancs21 / docker.sh
Created Aug 27, 2020
Install few-line
View docker.sh
# update first
sudo apt update
# install docker
curl -fsSL get.docker.com -o get-docker.sh && sudo sh get-docker.sh
# Add user to the "docker" group
sudo usermod -aG docker $USER
# install docker-compose
@ancs21
ancs21 / promise-with-shell-in-node.js
Last active Jul 20, 2019
Promise with shell in Node.js
View promise-with-shell-in-node.js
const { exec } = require('child_process')
/**
* Executes shell command and return as a Promise.
* @param cmd {string}
* @return {Promise<string>}
*/
const execShell = cmd => {
return new Promise((resolve, reject) => {
@ancs21
ancs21 / nodemailer.js
Created Nov 18, 2018
Send mail firebase function api
View nodemailer.js
import * as functions from 'firebase-functions'
import * as nodemailer from 'nodemailer'
import * as cors from 'cors'
const corsHandler = cors({ origin: true })
export const form = functions.https.onRequest((req, res) => {
const corsFn = cors()
corsFn(req, res, function() {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
View install-error-fix-tfjs-node.md

Please use version 8.11.3

yarn add @tensorflow/tfjs @tensorflow/tfjs-node

Error show

yarn add v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
@ancs21
ancs21 / 4.sql
Last active Nov 22, 2018
Database Management
View 4.sql
-- 4.1
create or replace procedure GoiTen(mgvien giaovien.magv%type)
is
tengv giaovien.hoten%type;
phaigv giaovien.phai%type;
begin
select hoten, phai into tengv, phaigv from giaovien where magv = mgvien;
if phaigv = '1' then
dbms_output.put_line('Co ' || tengv);
@ancs21
ancs21 / GUI.py
Last active Nov 23, 2018
AES-256 ECB and DES with PyCrypto
View GUI.py
# -*- coding: utf-8 -*-
from Crypto.Cipher import DES3
from Crypto.Cipher import AES
from Crypto import Random
# 1. Sinh khóa và lưu khóa
key = b'abcdefgh12345678'
# 2. Đọc khóa và tạo mật mã / giải mật mã DES (ECB, CBC)
@ancs21
ancs21 / docker-mysql.sh
Last active Nov 5, 2018
Install Docker on Ubuntu 16.04
View docker-mysql.sh
sudo docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=yourpassword -d mysql
# execute
sudo docker exec -it some-mysql sh