This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Records": [ | |
{ | |
"eventID": "a14537b9b153d5e7dece6e5587d71b75", | |
"eventName": "INSERT", | |
"eventVersion": "1.1", | |
"eventSource": "aws:dynamodb", | |
"awsRegion": "ap-southeast-1", | |
"dynamodb": { | |
"ApproximateCreationDateTime": 1568013979.0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo groupadd ftpaccess | |
sudo nano /etc/ssh/sshd_config | |
Add these lines to the bottom: | |
Match Group ftpaccess | |
ChrootDirectory /data/%u | |
ForceCommand internal-sftp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kafka import KafkaConsumer | |
import time | |
import multiprocessing | |
class Consumer(multiprocessing.Process): | |
def __init__(self): | |
multiprocessing.Process.__init__(self) | |
self.stop_event = multiprocessing.Event() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |