forked from sorellabs/fuck-you
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·33 lines (25 loc) · 1.09 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env node
if (process.argv.length < 4) {
console.log('Usage: fuck you [process]')
process.exit(1)
}
var exec = require('child_process').exec
var sanitise = JSON.stringify
var toArray = [].slice.call.bind([].slice)
var chars = " -_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
var flipped = " -_ɐqɔpǝɟɓɥıɾʞlɯuodbɹsʇnʌʍxʎz∀𐐒ƆᗡƎℲ⅁HIſ⋊⅂WNOԀΌᴚS⊥∩ΛMX⅄Z⇂ᄅƐㄣގ9ㄥ860"
var pname = process.argv[3]
exec('killall -9 ' + sanitise(pname), function(error, stdout, stderr) {
if (error == null) show('(╯°□°)╯︵', flip(pname))
else show('(; ̄Д ̄) . o O( It’s not very effective... )') })
function show() {
console.log('\n ' + toArray(arguments).join('') + '\n') }
function flip(name) {
return name.toLowerCase()
.split('')
.reverse()
.join('')
.replace(/./g, function(a) {
var i = chars.indexOf(a)
return i != -1? flipped[i]
: /* _ */ '' })}