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
if [ "$color_prompt" = yes ]; then | |
# this one should be active. it is ... | |
# <blue>directory</blue><br /><green>user@host</green>$ | |
PS1='\n\[\033[00;34m\]\w\[\033[00m\]\n${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]\$ ' | |
else | |
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' | |
fi | |
unset color_prompt force_color_prompt | |
# If this is an xterm set the title to user@host:dir |
/* | |
* Infects an object with a multi-cast property and method "mirroring". | |
* | |
* ``` | |
* observe(source, ['property_a', 'property_b', 'method_a']).mirror(target); | |
* ``` | |
* | |
* The `target` object will be invoked with the same calls/values as those | |
* made against the `source` on the listed properties and methods -- or | |
* ALL enumerable properties and methods if non are given. |
var node = document.createElement('div'); | |
node.innerHTML = "you know. hwhatever"; | |
document.body.insertBefore(node, document.body.firstElementChild); | |
var subnode1 = document.createElement('div'); | |
subnode1.innerHTML = "you know. hwhatever again (1)"; | |
node.appendChild(subnode1); | |
var subnode2 = document.createElement('div'); | |
subnode2.innerHTML = "you know. hwhatever again (2)"; |
var overload = function(...overloads) { | |
const f = function(...args) { | |
let constructorArray = args.map(arg => arg.constructor); | |
let implIndex = f.overloads.findIndex(sig => { | |
return constructorArray.length === sig.length && | |
constructorArray.every((o,i) => o === sig[i]) | |
; | |
}) + 1; | |
if (implIndex > 0 && typeof(f.overloads[implIndex]) === 'function') { | |
return f.overloads[implIndex].apply({}, args); |
bookmarklet
code.from copy import deepcopy | |
def insert_dict_leaves(source, additions): | |
rv = deepcopy(source) | |
for k, v in additions.items(): | |
if not (k in rv and isinstance(rv[k], dict)): | |
rv[k] = v | |
elif isinstance(v, dict): | |
rv[k] = insert_dict_leaves(rv[k], v) | |
else: |
def map_dict_leafs(d, f): | |
rv = {} | |
for k, v in d.items(): | |
if isinstance(v, dict): | |
rv[k] = map_dict_leafs(v, f) | |
else: | |
rv[k] = f(v) | |
return rv |