Skip to content

Instantly share code, notes, and snippets.

View masnick's full-sized avatar

Max Masnick masnick

View GitHub Profile
@masnick
masnick / SAS defaults.sas
Last active August 29, 2015 13:56
Sensible SAS defaults
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 (https://keybase.io/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:

-----BEGIN PGP MESSAGE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - https://gpgtools.org
hQEMA8MeMF20Q5DgAQf+IVPiuUEeCPfE+vbJRfDxVavbb2g0oRg7VZJCAfXRnRcX
pOE6lDIQeJrpMkoXwVC/Ks8XTJGc+Z+MPFyBZxw/iKtuL/Ij2vjHjCIZT95k5gZf
W8m5tYmryRQLb2+haMtgLnPvx8JPAK/79TExmFwwEsnfemVJDgwlQoTpJNWSZ08Z
1uRjZKw4MTRAjN/67jKCNun1C7WT+rzPOulRmlDTevSxDF8RCzLCeBSSQS+rc/Mp
NxHRK4ZCKT0Ul1qC35/d0FjNN/DBreOXYE8nzCEAAhfuk1LGCJrHLjAyfa5b7mKS
yN8y9+nezcaykFysSinazBOCVvupe0UY0d2rJD7ySdLpAUvy7UbgQZNHhvOzaC18
@masnick
masnick / gist:9761488
Last active August 29, 2015 13:57
Beats feedback

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
masnick / osx.bash
Created October 3, 2014 10:20
OS X preferences
#!/usr/bin/env bash
# ~/.osx — http://mths.be/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
masnick / gist:93571525a7204f50ee7c
Last active August 29, 2015 14:16
SAS code for getting PROC FREQ to make a 2×2 contingency table with the variables in the proper order
/* Set up some dummy data */
data tmp;
input exposure outcome count;
datalines;
0 0 6
0 1 2
1 0 4
1 1 11
;
| | Death | No death |
|-----------|-------|----------|
| Treatment | 4 | 0 |
| Control | 0 | 4 |
|-----------|-------|----------|
@masnick
masnick / Gemfile
Created April 3, 2015 13:47
Barebones LiveReload with guard example
source 'https://rubygems.org'
gem 'guard'
gem 'guard-livereload', '~> 2.4', require: false
gem 'rack-livereload'
gem 'sinatra'
gem 'thin'
@masnick
masnick / gist:d8d694a20b634329cc33
Created April 23, 2015 20:50
Rotate your desktop background immediately with this AppleScript
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

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname