Skip to content

Instantly share code, notes, and snippets.

@tonykung06
tonykung06 / golang_job_queue.md
Created March 20, 2017 02:10 — forked from harlow/golang_job_queue.md
Job queues in Golang
@tonykung06
tonykung06 / html5-video-streamer.js
Created August 27, 2016 18:09 — forked from paolorossi/html5-video-streamer.js
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@tonykung06
tonykung06 / golang-tls.md
Created July 27, 2016 15:09 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
    
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
@tonykung06
tonykung06 / mongodb_ssl_with_letsencrypt.md
Created July 23, 2016 09:20 — forked from leommoore/mongodb_ssl_with_letsencrypt.md
MongoDB 3.2.x SSL with Letsencrypt

#MongoDB 3.2.x SSL with Letsencrypt Letsencrypt is an initative which aims to increase the use of encryption for websites. It basically allows people to apply for free certificates provided that they prove the they control the requested domain. We will look at the what is needed to secure your MongoDB installation. For more details on setting up a MongoDB server see MongoDB 3.2.x.

##Set the hostname We sould to set the hostname to match the name of the certificate we are going to optain.

sudo hostname mongo0.example.com

Then update the hostname file to set the server name permanently.

@tonykung06
tonykung06 / .eslintrc
Created March 19, 2016 14:18 — forked from hendrikswan/.eslintrc
Packages and build config for Build Cross Platform React Native Apps with Exponent and Redux
{
"extends": "airbnb/base",
"plugins": [
"react"
],
"env": {
"node": true,
"jasmine": true,
},
"rules": {
@tonykung06
tonykung06 / nginx.conf
Created January 4, 2016 17:36 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@tonykung06
tonykung06 / git_submodules.md
Last active November 25, 2015 03:30 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.

by Dale Sande

I have been promoting the use of Sass' @extend function for some time now so it is safe to say that I have been very cautious of how this feature processes Sass into CSS. I still stand behind this feature and it is extremely powerful, but with power comes responsibility.

In a recent project I needed to apply some basic styling to some heading tags, we have all seen something like the following.

h1 {
  @include heading();
}
@tonykung06
tonykung06 / SassMeister-input.scss
Created September 28, 2015 17:10
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
.out {
%testing {
background: red;
}
}
@tonykung06
tonykung06 / lower-case-convention.md
Last active September 2, 2015 11:21 — forked from sebmarkbage/lower-case-convention.md
React JSX - Lower Case

Lower Case JSX Convention

All lower case JSX tags will now be treated as HTML/SVG elements. They will no longer be treated as custom components in scope.

The React element produced by JSX can be either a React class that exists in the local scope or a global scope HTML/SVG element depending on a convention.

Previous Behavior

Currently, when you use React JSX to define a HTML element you can use any known HTML tag. E.g: