Skip to content

Instantly share code, notes, and snippets.

@nikcub
nikcub / mails.sh
Created September 12, 2011 19:40
send email with mail.app via terminal
#!/bin/sh
/usr/bin/osascript > /dev/null <<ASCPT
set stdinText to "$(cat | sed -e 's/\\/\\\\/g' -e 's/\"/\\\"/g')"
set recipientName to "John Doe"
set recipientAddress to "[email protected]"
set theSubject to "Email from standard input"
set theContent to "This email was created and sent using AppleScript!"
tell application "Mail"
@nikcub
nikcub / mails.sh
Created September 12, 2011 19:43
Send email with Mail.app from command line script
#!/bin/sh
/usr/bin/osascript > /dev/null <<ASCPT
set stdinText to "$(cat | sed -e 's/\\/\\\\/g' -e 's/\"/\\\"/g')"
set recName to "Nik Cubrilovic"
set recAddr to "[email protected]"
set theSubject to "Email from standard input"
tell application "Mail"
@nikcub
nikcub / chrome.refresh.sh
Created October 31, 2011 03:05
Chrome Refresh
#!/bin/bash
# Chrome Refresh
#
# nik cubrilovic - nikcub.appspot.com
#
# Simple applescript browser reloader for Google Chrome. It will either open a
# new tab with the url passed in as an argument or refresh an existing tab.
#
# Link this up with watchr to auto-refresh browser windows when you save files
@nikcub
nikcub / admin.less
Created November 11, 2011 00:13
example bootstrap file
// to build:
// lessc <filename> > site.css
// lessc <filename> > site.min.css --compress
// the swatch
@color1: #55626b;
@color2: #6c9380;
@color3: #c1ca55;
@color4: #f07d6b;
@color5: #ad5472;
@nikcub
nikcub / gist:2634960
Created May 8, 2012 13:25
Comic Sansify

Comicsansify;")

@nikcub
nikcub / Spotify.scpt
Created August 20, 2012 16:43
Mute Spotify Ads
--Mute Spotify when ads are playing. Use if in a country where you can't
--purchase a pro account. Open AppleScript editor (Applications > Utilities)
--paste this script in and then go File -> Save As, change 'File Format' to
--'Application' and save somewhere. Run Spotify using that application.
set currentTrack to ""
do shell script "open -a \"Spotify\""
delay 5
@nikcub
nikcub / google-serp.user.js
Created September 14, 2012 07:21
rewrite google search result page to link directly to search result url
// Google SERP URL rewrite
//
// User script will rewrite search engine results page for Google and place real
// links to results rather than links that proxy back via google.
//
// So you go straight to the page when you click and you can copy/paste the link
//
// Install:
// 1. Download to desktop/wherever
// 2. Open Chrome extensions page (Window -> Extensions) or URL chrome://extensions
@nikcub
nikcub / nav.js
Created September 19, 2012 09:13
keyboard nav for xkcd 1110
// get the map element
var el = $('.map')[0];
// amount in pixels we want to move each keypress/hold
var move = 200;
function fakeMouseEvent(type, x, y) {
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent(type, true, true, window,
0, 0, 0, x, y, false, false, false, false, 0, null);
@nikcub
nikcub / clear-ga.sh
Created October 2, 2012 03:36
One-line shell script to clear all Google Analytics cookies from Chrome on OS X
#!/bin/bash
#
# shell script will clear all google analytics cookies from chrome cookie store
#
SQ3=`which sqlite3`
$SQ3 ~/Library/Application\ Support/Google/Chrome/Default/Cookies "delete from cookies where name like '__u%'"
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007