Skip to content

Instantly share code, notes, and snippets.

@digitaldrummerj
digitaldrummerj / secureUbuntuDockerSetup.md
Last active June 28, 2017 17:24
Docker ubuntu for using docker as a remote host

For Ubuntu 16.04 LTS and Docker CE 17.x

everything as sudo su

Server

Generate Certs

openssl genrsa -aes256 -out ca-key.pem 4096
@digitaldrummerj
digitaldrummerj / Sails-Snippets
Created November 20, 2017 00:46
Sails Snippets for Talk
{
/*
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
@digitaldrummerj
digitaldrummerj / gist:727c1543ec93b0ea9bcab4c9f187d85e
Last active March 13, 2020 03:26
JS: Convert String to Upper or Lower Based on Even or Odd without using ToUpperCase/ToLowerCase
function output(str, pos) {
var result = ''
for (var i = 0; i <= str.length; i++) {
var mod = i % 2;
var code = str.charCodeAt(i);
if (pos === 'even' && mod === 0) {
result += changeChar(code);
} else if (pos === 'odd' && mod !== 0) {
result += changeChar(code);
} else {