Skip to content

Instantly share code, notes, and snippets.

@vmlinz
vmlinz / generate_docker_cert.sh
Created October 11, 2019 13:54 — forked from bradrydzewski/generate_docker_cert.sh
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
@vmlinz
vmlinz / Enhance.js
Created August 23, 2016 07:04 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@vmlinz
vmlinz / nodejs-cluster-zero-downtime.md
Created July 28, 2016 04:48 — forked from jedi4ever/nodejs-cluster-zero-downtime.md
nodejs clustering, zero downtime deployment solutions

Clustering: The basics

The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)

It does not balance, it leaves it to the kernel.

In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)

@vmlinz
vmlinz / npm-cheat-sheet.md
Created June 27, 2016 14:51 — forked from AvnerCohen/npm-cheat-sheet.md
Node.js - npm Cheat Sheet

Node.js - npm Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Prepand ./bin to your $PATH Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:

NPM Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Install a package and also update package.json with the installed version and package name.

NPM Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Install a package and also update package.json with the installed version and package name.

@vmlinz
vmlinz / gist:98c4adceb5b1a9121c71b3a62f93b4a4
Created May 16, 2016 15:48 — forked from dodyg/gist:5616605
Kotlin Programming Language Cheat Sheet Part 2

This is a quick guide to Kotlin programming language. The previous part of this guide is here

#Object Oriented

fun main(args : Array<String>) {
  class local (val x : Int)
  
  val y = local(10)
 println("${y.x}")
@vmlinz
vmlinz / gist:26afd5f42d462b9142037819f99fcaff
Created May 16, 2016 15:47 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@vmlinz
vmlinz / gist:80bbf5aec7cbb452e014
Created February 10, 2016 07:18 — forked from geekdada/gist:53eb32e1032325a2ee60
My Chrome Extensions
1Password: Password Manager and Secure Wallet https://agilebits.com/onepassword
Adblock Plus https://chrome.google.com/webstore/detail/cfhdojbkjhnklbpkdaibdccddilifddb
Alisec Extension https://chrome.google.com/webstore/detail/lapoiohkeidniicbalnfmakkbnpejgbi
AngularJS Batarang https://chrome.google.com/webstore/detail/ighdmehidhipcmcojjgiloacoafjmpfk
Awesome Screenshot: Capture &amp; Annotate https://chrome.google.com/webstore/detail/alelhddbbhepgpmgidjdcjakblofbmce
@vmlinz
vmlinz / 0_reuse_code.js
Created February 10, 2016 07:18
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