Skip to content

Instantly share code, notes, and snippets.

View mattjmorrison's full-sized avatar

Matthew J Morrison mattjmorrison

View GitHub Profile
autoload -U colors && colors
autoload -U promptinit
autoload -Uz vcs_info
local reset white gray green red yellow blue cyan magenta black
reset="%{${reset_color}%}"
white="%{$fg[white]%}"
gray="%{$fg_bold[black]%}"
green="%{$fg_bold[green]%}"
red="%{$fg[red]%}"
diskutil list
diskutil unmountDisk /dev/diskN
sudo dd if=/path/to/iso of=/dev/diskN bs=1m
diskutil eject /dev/diskN
@mattjmorrison
mattjmorrison / refactor.coffee
Created April 25, 2013 20:59
Nice CoffeeScript refactor....
#Before
canModify: Ember.computed ->
value = false
description = @get('content.statusDescription')
if description is 'Unsent' or description is 'Do Not Send'
value = true
value
#After
>>> import pynotify
>>> pynotify.init("Test")
True
>>> pynotify.Notification("T", "B", "dialog-warning").show()
True
>>> pynotify.Notification("T", "B", "dialog-info").show()
True
>>> pynotify.Notification("T", "B", "dialog-error").show()
True
@mattjmorrison
mattjmorrison / notes.txt
Last active December 13, 2015 23:19
Ubuntu Setup Notes
install zsh
sudo apt-get -y install emacs23-nox zsh
wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
chsh -s $(which zsh)
.dotfiles repo
-> .emacs.d submodule
// Instead of
Someframework.object.create({
my: 'attributes',
go: 'here'
});
// Try doing this
function MyObject(){
this.my = "attributes";
this.go = "here";
@mattjmorrison
mattjmorrison / jsproperties.js
Created December 29, 2012 04:37
Getter / Setter style properties for javascript... sorta
(function(){
var console = {
log: function(message){
$('body').append(message + "<br />");
}
};
var __bind_prop = function(fn, me, name){
return function(){
var args = [name];
for (var x=0;x<arguments.length;x++){
@mattjmorrison
mattjmorrison / epicfail.txt
Created December 23, 2012 19:15
Trying to figure out how to use r.js freaking deleted everything (including .git) in my cwd!
(emberdemo)[emberdemo] node_modules/requirejs/bin/r.js -o baseUrl=. name=main ☁ master ☀
Error: Missing either an "out" or "dir" config value. If using "appDir" for a full project optimization, use "dir". If you want to optimize to one file, use "out".
at Function.build.createConfig (/Users/mattjmorrison/Projects/emberdemo/node_modules/requirejs/bin/r.js:22707:19)
(emberdemo)[emberdemo] node_modules/requirejs/bin/r.js -o baseUrl=. name=main dir=. ☁ master ☀
Error: ENOENT, no such file or directory
at Object.exports.resolve (path.js:284:52)
(emberdemo)[emberdemo] node_modules/requirejs/bin/r.js -o baseUrl=. name=main out=main.js
zsh: no such file or directory: node_modules/requirejs/bin/r.js
@mattjmorrison
mattjmorrison / .emacs
Created December 7, 2012 04:43
Emacs Config
(add-to-list 'load-path "~/.emacs.d/plugins")
(require 'color-theme)
(color-theme-initialize)
(color-theme-midnight)
(set-face-attribute 'default nil :height 130)
(add-to-list 'load-path "~/.emacs.d/vendor")
(load-file "~/.emacs.d/emacs-for-python/epy-init.el")
(require `tramp)
(load-file "~/.emacs.d/emacs-for-python/epy-pylint.el")
(load-file "~/.emacs.d/emacs-for-python/epy-flake8.el")
@mattjmorrison
mattjmorrison / default
Created December 3, 2012 13:17
nginx config
server {
listen 80;
}
server {
listen 80;
server_name python.sample.com;
location / {
auth_basic "Restricted";
auth_basic_user_file htpasswd;