Skip to content

Instantly share code, notes, and snippets.

@nrollr
nrollr / Screenshots.sh
Last active Oct 3, 2015
Change the file location of screencaptures on OS X
View Screenshots.sh
#!/bin/bash
defaults write com.apple.screencapture location ~/Screenshots
killall SystemUIServer
@nrollr
nrollr / BackupThunderbird.applescript
Last active Dec 24, 2015
Applescript to backup Thunderbird directory as .zip File
View BackupThunderbird.applescript
-- 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 Jan 16, 2016
Save open Safari tabs to Reminders.app
View SafariToReminders.applescript
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 Feb 28, 2016
Code to include custom Fonts in CSS
View font-face.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 Jul 25, 2016
Performance improvements for El Capitan
View ElCapitan.applescript
-- 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 Feb 4, 2018
SMS notification using the Twilio API
View Twilio_notification.php
<?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 Mar 28, 2018
Ruby and Rails on El Capitan
View Ruby_and_Rails.md

#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 Nov 10, 2018
Retrieve file location of all items in the iTunes Library
View iTunesMediaLocation.sh
#!/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 Oct 2, 2019
Generate SSH keys
View SSHKeys.sh
#!/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 / HTTPCheckStatus.applescript
Created Nov 29, 2015
Script to validate list or URL's based on the HTTP status code
View HTTPCheckStatus.applescript
-- Replace 'username' in the path with your own (lines 2 & 3)
set inputFile to "/Users/username/Documents/ListURL.txt"
set outputFile to "/Users/username/Documents/StatusURL.txt"
set txtList to paragraphs of (read inputFile)
set {TID, my text item delimiters} to {my text item delimiters, ";"}
repeat with txtLines in txtList
set {theURL} to text items of txtLines
set theScript to "curl -o /dev/null -s -I -w '%{http_code}' " & theURL