Skip to content

Instantly share code, notes, and snippets.

@nsporillo
nsporillo / minechat.js
Last active November 18, 2017 06:16
Decent CLI chat client for minecraft 1.6.4 using minecraft-protocol Uses https://github.com/loopj/commonjs-ansi-colorDoesn't support all colors AFAIK, furthermore it's probably not the most efficient way to handle colored chat. Used buffers to deal with the § character, not sure if this can be done without doing that.
var readline = require('readline');
var color = require("ansi-color").set;
var mc = require('../');
var c = new Buffer("§", "utf-8")
var colors = new Array();
colors[c.toString('utf-8') + '0'] = 'black+white_bg';
colors[c.toString('utf-8') + '1'] = 'white+blue_bg';
colors[c.toString('utf-8') + '2'] = 'green';
colors[c.toString('utf-8') + '3'] = 'blue';
@unapersona
unapersona / transfinish.sh
Created August 10, 2012 09:26
Pushover notification on Transmission file completed
#!/bin/sh
curl -s \
-F "token=APP_TOKEN" \
-F "user=USER_TOKEN" \
-F "title=Download Finished" \
-F "message=$TR_TORRENT_NAME: $TR_TIME_LOCALTIME" \
http://api.pushover.net/1/messages > /dev/null
@pheuter
pheuter / sc-dl.js
Created March 5, 2012 20:44
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
@Dalboz
Dalboz / vlc-avcapture.sh
Last active November 24, 2022 14:14
redirect isight stream to vlc using avcapture OSX
/Applications/VLC.app/Contents/MacOS/vlc avcapture:// -vvv input_stream --sout='#duplicate{dst=display, dst="transcode{venc=x264{keyint=60,idrint=2},vcodec=h264,vb=300,acodec=mp4a,ab=3 2,channels=2, samplerate=22050}:rtp{dst=127.0.0.1,port=1234,sdp=file:////vlc.sdp}"}'