Skip to content

Instantly share code, notes, and snippets.

View dotslashf's full-sized avatar
💻
Tinkering

fadhlu dotslashf

💻
Tinkering
View GitHub Profile
@dotslashf
dotslashf / sp
Last active December 7, 2019 19:55 — forked from rarrais/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#Edited to allow for authentication with Spotify API required for search function.
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
function collatzConjecture(num) {
if (num % 2 === 0) {
return num / 2;
} else if (num % 2 === 1) {
return num * 3 + 1;
} else if (num === 1) {
return 1;
}
}