Skip to content

Instantly share code, notes, and snippets.

View hieptuanle's full-sized avatar
🎯
Focusing

Hiep Le hieptuanle

🎯
Focusing
  • 4handy
  • Hanoi, Vietnam
View GitHub Profile
@hieptuanle
hieptuanle / check-domain-port.js
Created January 22, 2018 04:49
Check status for port of domain
const dns = require('dns')
const portscanner = require('portscanner')
dns.lookup('abc.myq-see.com', function(err, result) {
if (err) return console.log('err', err)
portscanner.checkPortStatus(34586, result, function(err, status) {
console.log('err1', err)
console.log('status', status) // open means port is being used
})
})
@hieptuanle
hieptuanle / 4handy-work
Last active November 26, 2017 16:47
Nginx configuration for macos
server {
listen 443 ssl http2;
server_name local.4-handy.com;
root /Users/hieple/Code/4handy-work-2/public;
# security
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
ssl_ecdh_curve secp384r1;
ssl_certificate /usr/local/etc/nginx/ssl/localwork.pem;
const debug = _.curry((tag, x) => {
console.log(tag, x)
return x
})
$http.get('/quizzes/' + $stateParams.quizId + '/do')
.success(function (response) {
$scope.paper = response.paper
const questions = response.paper.questions
@hieptuanle
hieptuanle / 0_reuse_code.js
Created June 18, 2016 17:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console