Skip to content

Instantly share code, notes, and snippets.

View mattsson's full-sized avatar

Marcus Mattsson mattsson

View GitHub Profile
@simonbs
simonbs / Import Contacts from Slack.js
Created October 26, 2018 22:56
Scriptable script that imports contacts from Slack. Existing contacts will also have their avatar and social profiles updated. The contacts must have their phone number set in Slack.
// In order to use the script,
// you must create a Slack bot
// with the user:read scope and
// generate an accesss token.
// The script will prompt you
// to copy the access token in.
// The token is stored securely
// in the keychain.
let containers = await ContactsContainer.all()
let contacts = await Contact.all(containers)
@sk22
sk22 / lastfm-remove-duplicates.js
Last active January 13, 2024 16:26
Last.fm duplicate scrobble deleter
var elements = Array.from(document.querySelectorAll('.js-link-block'))
elements.map(function (element) {
var nameElement = element.querySelector('.chartlist-name')
return nameElement && nameElement.textContent.replace(/\s+/g, ' ').trim()
}).forEach(function (name, i, names) {
if (name !== names[i + 1]) return
var deleteButton = elements[i].querySelector('[data-ajax-form-sets-state="deleted"]')
if (deleteButton) deleteButton.click()
location.reload()
})
@ralph089
ralph089 / .wakeup
Last active February 17, 2024 09:56
Restarts Bluetooth Module on Mac OS X. You can use the script as shortcut to restart Bluetooth on demand or you can use it with "SleepWatcher" to automatically restart Bluetooth on wakeup (See README.md). I created it, because my Logitech Bluetooth Mouse doesn't stay connected after sleep-mode, so i had to manually re-pair my mouse.
#!/bin/bash
#
# Restart Bluetooth Module on Mac OS X
#
# Requires Blueutil to be installed: http://brewformulas.org/blueutil
BT="/usr/local/bin/blueutil"
log() {
echo "$@"
@keijiro
keijiro / transfer.sh
Created December 24, 2015 10:36
Transferring a repository from GitHub to BitBucket.
git clone --mirror https://github.com/keijiro/Foobar.git
git remote set-url --push origin https://keijiro@bitbucket.org/keijiro/Foobar
git push --mirror
@natelandau
natelandau / .bash_profile
Last active April 30, 2024 18:07
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management