Skip to content

Instantly share code, notes, and snippets.

View resba's full-sized avatar
👀

Matt Sowden resba

👀
View GitHub Profile
@jgamblin
jgamblin / slackspotify.sh
Created April 19, 2017 01:10
A Script To Set Current Spotify Song As Slack Status
#!/bin/bash
APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens"
SONG=$(osascript -e 'tell application "Spotify" to name of current track as string')
URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
while true
do
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null
sleep 60
done
@futuremill-ltd
futuremill-ltd / gist:2318876
Created April 6, 2012 11:00
Building Ruby 1.9.3 package for Debian Squeeze
# From a fresh install of squeeze
apt-get install ruby rubygems # Need ruby to use fpm
gem1.8 install fpm --no-ri --no-rdoc
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -zxvf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125
rm -rf /tmp/ruby193
@resba
resba / hideDiv.js
Created April 25, 2011 17:51
hideDiv Javascript Function
// hideDiv Function v1.5 by Matthew Sowden. Based off the Middle Bucks Institute of Technology Online Yearbook Student Content Check Script, Originally Designed by Matthew Sowden.
// Author: Matthew Sowden (designtheinternet@gmail.com)
// Website: www.resbah.com
// Disclaimer: This code is provided on an AS-IS basis and does NOT offer any support.
// License: You are free to use this code in any project or modify it in any way, so long as the credit is given.
function hideDiv(div,datacheck){
if (document.getElementById(datacheck).innerHTML == '') //Statement checks to see if datacheck contains any text between the opening and closing tag.
{
document.getElementById(div).innerHTML = ''; //If the above statement is TRUE, this ID-defined element has its content set to nothing.