Skip to content

Instantly share code, notes, and snippets.


Max Masnick masnick

View GitHub Profile
masnick / SAS
Last active Aug 29, 2015
Sensible SAS defaults
View SAS
dm 'odsresults; clear';; /* Clears results from Results bar every time you run this line. */
dm 'clear log'; /* Clear the log window every time you run this line. */
dm 'clear out'; /* Clear the output file every time you run this line. */
ods listing; /* Turn on old style output */
options nodate pageno=1 linesize=80 pagesize=60 source; /* Old style output display settings */

Keybase proof

I hereby claim:

  • I am masnick on github.
  • I am masnick ( on keybase.
  • I have a public key whose fingerprint is B899 A28A 08DF ABEF F98F B8A6 DCCA 9E3F D712 5546

To claim this, I am signing this object:

View tenderlove.txt
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools -
masnick / gist:9761488
Last active Aug 29, 2015
Beats feedback
View gist:9761488

I switched to Beats because the iPhone app is great, and the Rdio app (my previous music service) did not handle offline music well.

Unfortunately, I listen to most music through my computer, and the Beats web player is terrible. I know you're working on improving it, but some issues, like logging me out every 24 hours, are just bad design decisions. Little progress has been made on the web player since I signed up, and the current buggy player is too annoying to continue using.

Other issues with the web player:

  • Playback randomly cutting out, requiring a refresh to fix
  • Stopping and then resuming playback after more than a few minutes was very unreliable: clicking "play" wouldn't start the track again, and none of the play icons for other tracks would work. Refreshing was the only solution (and sometimes I'd be inexplicably logged out), and the app wasn't smart enough to remember what I was listening to so I'd have to manually navigate back to where I was.
  • Can't view library on web player
  • Requires Fl
masnick / modified-zotselect-link.js
Last active Aug 29, 2015
Zotero export translator for getting zotero:// link and article information
View modified-zotselect-link.js
masnick / osx.bash
Created Oct 3, 2014
OS X preferences
View osx.bash
#!/usr/bin/env bash
# ~/.osx —
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
masnick / gist:93571525a7204f50ee7c
Last active Aug 29, 2015
SAS code for getting PROC FREQ to make a 2×2 contingency table with the variables in the proper order
View gist:93571525a7204f50ee7c
/* Set up some dummy data */
data tmp;
input exposure outcome count;
0 0 6
0 1 2
1 0 4
1 1 11
View gist:c935c75dd02adbb17501
| | Death | No death |
| Treatment | 4 | 0 |
| Control | 0 | 4 |
masnick / Gemfile
Created Apr 3, 2015
Barebones LiveReload with guard example
View Gemfile
source ''
gem 'guard'
gem 'guard-livereload', '~> 2.4', require: false
gem 'rack-livereload'
gem 'sinatra'
gem 'thin'
masnick / gist:d8d694a20b634329cc33
Created Apr 23, 2015
Rotate your desktop background immediately with this AppleScript
View gist:d8d694a20b634329cc33
tell application "System Events"
set desktopnames to get display name of every desktop
repeat with currentdesktop in desktopnames
tell (every desktop whose display name is currentdesktop)
set initInterval to get change interval -- get the currrent display interval
set change interval to -1 -- force a change to happen right now
set change interval to initInterval -- change it back to the original display interval
end tell
end repeat
end tell