Skip to content

Instantly share code, notes, and snippets.

View DonerKebab's full-sized avatar
💀

Phuong Nguyen DonerKebab

💀
View GitHub Profile
@DonerKebab
DonerKebab / get_value_radio.html
Created November 25, 2019 15:58
get selected value in radio button
<!DOCTYPE html>
<html>
<body>
<p>Please select your gender:</p>
<input type="radio" name="gender" id="r1" value="male"> Male<br>
<input type="radio" name="gender" id="r2" value="female"> Female<br>
<input type="radio" name="gender" id="r3" value="other"> Other<br>
<button onclick="selectValue()">Save</button>
@DonerKebab
DonerKebab / gacon.html
Created November 22, 2019 01:58
hien thi error message su dung visibility
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Page Title</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
</head>
<body>
<div>
@DonerKebab
DonerKebab / gacon.html
Created November 22, 2019 01:58
hien thi error message su dung visibility
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Page Title</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
</head>
<body>
<div>
@DonerKebab
DonerKebab / remove_duplicate_items.js
Created November 20, 2019 08:46
for little chicken
function removeDuplicatedItem(inputArray) {
// create a new array to store unique items
var unduplicatedArray = [inputArray[0]];
// start looping from 1st item cause we already put the first item into `unduplicatedArray`
for (let i = 1; i < inputArray.length; i++) {
// create a flag to store the duplicate status of item
var existing = false;
# start working on a new issue
$ git checkout develop
$ git pull origin
$ git checkout -b {feature}/{ticket-id}-{name}
# finish working on an issue
$ git status
{
"Records": [
{
"eventID": "a14537b9b153d5e7dece6e5587d71b75",
"eventName": "INSERT",
"eventVersion": "1.1",
"eventSource": "aws:dynamodb",
"awsRegion": "ap-southeast-1",
"dynamodb": {
"ApproximateCreationDateTime": 1568013979.0,
encryptData: async function() {
const kms = new AWS.KMS();
const params = {
KeyId: "arn:aws:kms:eu-west-1:846317326898:key/937948cd-8e08-49cb-9a59-5e2e62e7f70c", // your key alias or full ARN key
Plaintext: "nguyen huy phuong - 987897 - 123456", // your super secret.
}
kms.encrypt(params).promise().then(data => {
const base64EncryptedString = data.CiphertextBlob.toString('base64');
console.log('base64 encrypted string: ' + base64EncryptedString);
sudo groupadd ftpaccess
sudo nano /etc/ssh/sshd_config
Add these lines to the bottom:
Match Group ftpaccess
ChrootDirectory /data/%u
ForceCommand internal-sftp
@DonerKebab
DonerKebab / kafka_example.py
Last active May 10, 2018 04:14
python kafka example
from kafka import KafkaConsumer
import time
import multiprocessing
class Consumer(multiprocessing.Process):
def __init__(self):
multiprocessing.Process.__init__(self)
self.stop_event = multiprocessing.Event()
#FROM http://mikelynchgames.com/software-development/installing-oracle-instant-client-and-sqlplus-on-osx/
#REQUIRED
# instantclient-basic-macosx-<version>.zip
# instantclient-sdk-macosx-<version>.zip
# instantclient-sqlplus-macosx-<version>.zip
# put this script in the same folder as these downloaded