Skip to content

Instantly share code, notes, and snippets.

View vshelke's full-sized avatar
🔬
experimenting

Vaibhav Shelke vshelke

🔬
experimenting
View GitHub Profile
@vshelke
vshelke / better-nodejs-require-paths.md
Created May 22, 2018 20:04 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

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:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@vshelke
vshelke / Instructions.md
Created February 25, 2018 21:38 — forked from jmdobry/Instructions.md
Nginx reverse-proxy for RethinkDB Admin UI

Start your rethinkdb instance with this flag: --bind all (or bind=all in the configuration file for your instance)

Block external access to the web UI with these two commands: sudo iptables -A INPUT -i eth0 -p tcp --dport 8080 -j DROP sudo iptables -I INPUT -i eth0 -s 127.0.0.1 -p tcp --dport 8080 -j ACCEPT

Install nginx: sudo apt-get install nginx

@vshelke
vshelke / song-downloader.sh
Last active August 22, 2017 18:53
Easy song download
echo "press enter to start downloading : "
echo $(pbpaste)
cd ~/Music/my/
read
url=$(pbpaste)
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 $url
osascript -e 'display notification "Download Complete!" with title "Audio Downloader"'