I'm in a hospital in Spain and my MacBook was stolen.
Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.
I'm in a hospital in Spain and my MacBook was stolen.
Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.
jcmd is a powerful new tool introduced in Java 7. Along with jstack
and jps
, it should be in your go-to tool for solving production problems on the JVM. (Come to think of it, with this tool you don't really need jps
anymore)
Here's an example session with jcmd
:
$ ssh wopr.qa.corp.local
$ jcmd -l
34739 sun.tools.jcmd.JCmd -l
#!/bin/bash | |
git clone https://github.com/hashcat/hashcat.git | |
mkdir -p hashcat/deps | |
git clone https://github.com/KhronosGroup/OpenCL-Headers.git hashcat/deps/OpenCL | |
cd hashcat/ && make | |
./hashcat --version | |
./hashcat -b -D 1,2 | |
./example0.sh |
var uniqueArray = function(arrArg) { | |
return arrArg.filter(function(elem, pos,arr) { | |
return arr.indexOf(elem) == pos; | |
}); | |
}; | |
var uniqEs6 = (arrArg) => { | |
return arrArg.filter((elem, pos, arr) => { | |
return arr.indexOf(elem) == pos; | |
}); |
# | |
# NB : this is not secure | |
# from http://code.activestate.com/recipes/266586-simple-xor-keyword-encryption/ | |
# added base64 encoding for simple querystring :) | |
# | |
def xor_crypt_string(data, key='awesomepassword', encode=False, decode=False): | |
from itertools import izip, cycle | |
import base64 | |
if decode: |
// http://stackoverflow.com/questions/11616630/json-stringify-avoid-typeerror-converting-circular-structure-to-json/11616993#11616993 | |
var o = {}; | |
o.o = o; | |
var cache = []; | |
JSON.stringify(o, function(key, value) { | |
if (typeof value === 'object' && value !== null) { | |
if (cache.indexOf(value) !== -1) { | |
// Circular reference found, discard key | |
return; |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.