Skip to content

Instantly share code, notes, and snippets.

@rainder
rainder / self-signed-certificate-with-custom-ca.md
Created July 12, 2019 22:12 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@rainder
rainder / install-node.sh
Created July 28, 2017 13:54
install node.js
#!/usr/bin/env bash
get_os() {
local UNAME
UNAME="$(command uname -a)"
local OS
case "$UNAME" in
Linux\ *) OS=linux ;;
Darwin\ *) OS=darwin ;;
@rainder
rainder / k8s-backup.js
Created July 27, 2017 12:15
kubernetes cluster backup script
#!/usr/bin/env node
'use strict';
/**
*
* Usage example
*
* To dump cluster configuration to the file use
*
* `node ./k8s-backup.js [--context=...] > dump.json`
'use strict';
var bresenham = require('bresenham');
var glmatrix = require('gl-matrix');
const terminal = require('terminal-kit').terminal;
var Canvas = require('drawille');
var mat4 = glmatrix.mat4;
var vec3 = glmatrix.vec3;
terminal.fullscreen();
@rainder
rainder / make-transformable.js
Last active January 25, 2016 11:07
makeTransformable
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function () {
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function () {
(function () {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;
getTransform = function (from, to) {
var A, H, b, h, i, k_i, lhs, rhs, _i, _j, _k, _ref;
@rainder
rainder / JS::sort object by value.js
Last active January 25, 2016 11:07
JS::sort object by value
/**
*
* @param {object} object An object to sort
* @param {boolean} [reverse=false] Sort direction
* @returns {{}}
*/
function sortObject(object, reverse) {
var result = {};
(function () {
fs = require 'fs'
_ = require 'lodash'
###
* @link http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata
###
wrap = (data) -> """
<?php
'use strict';
function DeferredFnStack(fn) {
let stack = Promise.resolve();
return (...args) => {
const dfd = defer();
stack = stack
.catch(() => null)