Skip to content

Instantly share code, notes, and snippets.

@nrollr
nrollr / Screenshots.sh
Last active October 3, 2015 19:35
Change the file location of screencaptures on OS X
#!/bin/bash
defaults write com.apple.screencapture location ~/Screenshots
killall SystemUIServer
@nrollr
nrollr / BackupThunderbird.applescript
Last active December 24, 2015 17:24
Applescript to backup Thunderbird directory as .zip File
-- Copy Thunderbird directory to /Users/{username}/Temp/
set mailFolder to ((path to home folder) as text) & "Library:Thunderbird" as alias
set tempFolder to ((path to home folder) as text) & "Temp" as alias
tell application "Finder"
duplicate folder mailFolder to folder tempFolder with replacing
end tell
-- Compress the Thunderbird copy
set destinationFolder to ((path to home folder) as text) & "Temp" as alias
set sourceFolder to ((path to home folder) as text) & "Temp:Thunderbird" as alias
@nrollr
nrollr / SafariToReminders.applescript
Created January 16, 2016 15:16
Save open Safari tabs to Reminders.app
set currentTab to 0
set the dateStamp to ((the current date) as string)
set listName to "Open Safari Tabs, dated: " & the dateStamp
tell application "Safari"
activate
set safariWindow to the front window
set successCount to 0
set tabCount to (count of (tabs of safariWindow))
@nrollr
nrollr / font-face.css
Created February 28, 2016 14:23
Code to include custom Fonts in CSS
@font-face {
font-family: 'name_font';
src:url('fonts/name_font.eot');
src:url('fonts/name_font.eot?#iefix') format('embedded-opentype'),
url('fonts/name_font.woff') format('woff'),
url('fonts/name_font.ttf') format('truetype'),
url('fonts/name_font.svg#bpicons') format('svg');
font-weight: normal;
font-style: normal;
@nrollr
nrollr / ElCapitan.applescript
Last active July 25, 2016 13:32
Performance improvements for El Capitan
-- Disable Time Machine Local Backups
sudo tmutil disablelocal
-- Disable Automatic Spell Checker
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false
-- Disable animations when opening and closing windows.
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
-- Disable animations when opening a Quick Look window.
defaults write -g QLPanelAnimationDuration -float 0
-- Accelerated playback when adjusting the window size (Cocoa applications).
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
@nrollr
nrollr / Twilio_notification.php
Last active February 4, 2018 19:48
SMS notification using the Twilio API
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once 'twilio/autoload.php'; // Loads the library
use Twilio\Rest\Client;
// Your account details via twilio.com/user/account
$sid = "xxxxxxxxxxxxxxxxxx"; //Account Sid
$token = "xxxxxxxxxxxxxxxxxx"; //Auth Token
$client = new Client($sid, $token);
@nrollr
nrollr / Ruby_and_Rails.md
Last active March 28, 2018 17:57
Ruby and Rails on El Capitan

#Install Ruby and Rails on El Capitan The following procedure was used to install the required components on El Capitan (clean install)

First make sure Xcode Command Line Tools are installed.
Open Terminal and enter: xcode-select --install you will be prompted to start the installation. Once finished proceed..

##Install Homebrew Important Notice: Homebrew and El Capitan, make sure to read the article!

  • Enter the following command: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@nrollr
nrollr / iTunesMediaLocation.sh
Last active November 10, 2018 23:43
Retrieve file location of all items in the iTunes Library
#!/bin/bash
# Extract file location of each item from iTunes Music Library.xml (renamed to iTunes.xml)
sed -n 's/.*<key>Location<\/key><string>\([^<]*\)<\/string>.*/\1/p' iTunes.xml > FileLocation.txt
@nrollr
nrollr / SSHKeys.sh
Last active October 2, 2019 06:46
Generate SSH keys
#!/bin/bash/
ls -al ~/.ssh # Lists existing files in your .ssh directory
ssh-keygen -t rsa -b 4096 -C "your_email@domain.com" # Creates new ssh key, using the provided email as label
eval "$(ssh-agent -s)" # Ensure ssh-agent is enabled
ssh-add ~/.ssh/id_rsa # Add ssh key to the ssh-agent
@nrollr
nrollr / MySQL.md
Last active October 28, 2020 02:53
Install MySQL on El Capitan using Homebrew

Install MySQL on OS X El Capitan

Normally the installation of MySQL can be achieved with a single command, which executes a script provided by MacMiniVault : bash <(curl -Ls http://git.io/eUx7rg)

However, at the time of writing the script is not compatible with OS X El Capitan (10.11)

Install MySQL using Homebrew

An alternative to the aforementioned installation script is installing MySQL using Homebrew. This gist assumes you already have Homebrew installed, if not first read the article "Homebrew and El Capitan"

Make sure Homebrew has the latest formulae, so run brew update first