Skip to content

Instantly share code, notes, and snippets.

View AlexxNica's full-sized avatar
🚀

Alexandre Nicastro AlexxNica

🚀
View GitHub Profile

Enable Docker Remote API with TLS client verification

Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:

  • CA certificate
  • Server certificate
  • Server key
  • Client certificate
  • Client key

Create certificate files

@AlexxNica
AlexxNica / Remote API via daemon.json.md
Created December 22, 2017 14:05 — forked from kekru/Remote API via daemon.json.md
Enable Docker Remote API via daemon.json
@AlexxNica
AlexxNica / github-languages-stats.json
Created December 16, 2017 08:02 — forked from paulmillr/github-languages-stats.json
Most active GitHub users raw data
{
"Total": 963
}
@AlexxNica
AlexxNica / 0.md
Created December 4, 2017 18:23 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@AlexxNica
AlexxNica / perf-flame-graph-notes.md
Created December 4, 2017 14:11 — forked from trevnorris/perf-flame-graph-notes.md
Quick steps of how to create a flame graph using perf

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
@AlexxNica
AlexxNica / inception.js
Created December 1, 2017 16:27 — forked from cowboy/inception.js
JavaScript: inception(inception);
function inception(f) {
try {
return 'recursion puts the "' + f.name + '" in "' + f(f) + '"';
} catch (e) {
return '';
}
}
@AlexxNica
AlexxNica / Bevry-Code-of-Conduct.md
Created November 15, 2017 22:42 — forked from balupton/Bevry-Code-of-Conduct.md
Seems the open-source world requires a code of conduct for everything right now. So here is a draft one I’ve done up for Bevry. Feedback welcome.

Bevry Draft Code of Conduct

TLDR: Be a productive member of civilised society, no more, no less.

Results > Character > Identity.

We care only about your character and your results. We discriminate at the individual level, not the group identity level. You can be whatever identity you want, your identity is your thing not ours, identity is meaningless to us.

Libertarian Values.

@AlexxNica
AlexxNica / arrayBufferToString.js
Created November 12, 2017 18:35 — forked from skratchdot/arrayBufferToString.js
Array Buffer -> String and String -> ArrayBuffer conversions in javascript
// source: http://stackoverflow.com/a/11058858
function ab2str(buf) {
return String.fromCharCode.apply(null, new Uint16Array(buf));
}
function makeAtomicOps(ofType) {
function makeRMW(opName) {
return function(bytes, offset, ptr, value) {
return Module['_BinaryenAtomicRMW'](module, Module[opName], bytes, offset, ptr, value, ofType);
};
}
return {
'rmw': {
'add': makeRMW('AtomicRMWAdd'),
'sub': makeRMW('AtomicRMWSub'),
@AlexxNica
AlexxNica / Middleware.js
Created November 9, 2017 21:04 — forked from unbug/Middleware.js
Powerful Javascript Middleware Pattern Implementation, apply middleweares to any object. https://unbug.github.io/js-middleware/
'use strict';
/* eslint-disable consistent-this */
let middlewareManagerHash = [];
/**
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for
* the resulting composite function.
*