Skip to content

Instantly share code, notes, and snippets.

View nathan-v's full-sized avatar
🇺🇸

Nathan V nathan-v

🇺🇸
View GitHub Profile
@nathan-v
nathan-v / update_dev_envs.sh
Created September 27, 2017 21:26
Script to quickly update *env tools like RBEnv
#!/bin/bash
# Dev env update script for *env tools
# Supports: RBEnv, RBEnv Ruby Build plugin, PyEnv, GoEnv
if [ -d "$HOME/.rbenv/" ]; then
echo "Updating RbEnv..."
cd $HOME/.rbenv/
git pull
echo -e "...done.\n"
@nathan-v
nathan-v / np-to-slack.py
Created December 22, 2017 18:09
Pulls my 'now playing' track from Last.fm and posts it to Slack as my status with the 🎧 emoji.
#!/usr/bin/env python
# coding: utf-8
#
# Nowplaying (via Last.fm) to Slack
# Author: Nathan V <Nathan.V@gmail.com>
#
# Copyright 2017 Nathan V
# License: MIT; https://opensource.org/licenses/MIT
# This simple little script could be expanded to support command line
# args, multiple sources, and multiple Slack domains... but for now it
@nathan-v
nathan-v / fb_media_export_date_fixer.py
Created January 6, 2020 22:47
Facebook Photos & Videos Export Date Fixer -- Sets the file dates to the dates from Fb
#!/usr/bin/env python
# coding: utf-8
#
# Facebook Photos & Videos Export Date Fixer
# Author: Nathan V <Nathan.V@gmail.com>
#
# Copyright 2019 Nathan V
# License: MIT; https://opensource.org/licenses/MIT
#
# Works on Python 3+
@nathan-v
nathan-v / .bashrc
Created March 14, 2020 00:54
Handy little title setter that makes sure that the title always reflects where you are and what is going on it git in that directory
# Title setting function
function git_title {
# See if we're in a git path
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) = true ]]; then
# Set the title to <git parent folder name>:<current branch> like "mycoollib:master"
echo -ne "\033]0;$(basename `git rev-parse --show-toplevel`):$(git rev-parse --abbrev-ref HEAD)\007"
else
# Set the title to the present working directory
echo -ne "\033]0;$PWD\007"
fi