Skip to content

Instantly share code, notes, and snippets.

View alexcabrera's full-sized avatar

Alex Cabrera alexcabrera

View GitHub Profile
@alexcabrera
alexcabrera / gist:3902923
Created October 17, 2012 00:09
Kill Dashboard - Mountain Lion
# Run the following from the command line
defaults write com.apple.dashboard mcx-disabled -boolean YES;killall Dock
<!doctype html>
<html>
<head><title>Joshers</title></head>
<body><img src="http://www.502underground.net/forum/images/smilies/joshers.gif"></body>
</html>
@alexcabrera
alexcabrera / gist:3698938
Created September 11, 2012 14:18
Fancy 2-line bash prompt with git branch name
# Prompt Colors
prompt_purple=$(tput setaf 5)
prompt_cyan=$(tput setaf 6)
prompt_yellow=$(tput bold ; tput setaf 3)
prompt_green=$(tput setaf 2)
prompt_reset=$(tput sgr0)
# Display git branch
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
@alexcabrera
alexcabrera / writer
Created August 14, 2012 02:52 — forked from brendanjerwin/writer
open iA writer from the command line
#! /bin/bash
touch $1
open $1 -a /Applications/iA\ Writer.app
@alexcabrera
alexcabrera / _media_queries.sass
Created May 16, 2012 22:00
Best. Mixin. Ever.
$break_small: 320px
$break_large: 1024px
@mixin respond-to($media)
@if $media == handhelds
@media only screen and (max-width: $break_small)
@content
@else if $media == medium-screens
@media only screen and (min-width: $break_small + 1) and (max-width: $break_large - 1)
@content
+background-image(linear-gradient(top, $background_blue, $background_blue U(10), lighten($background_blue, 10%) U(5), lighten($background_blue, 10%) U(5), lighten($background_blue, 20%) U(3), lighten($background_blue, 20%) U(3), lighten($background_blue, 30%) U(3), lighten($background_blue, 30%) U(3)))
"Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Vestibulum id ligula porta felis euismod semper. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. ",
["img_ref", {"text": "![An inline gallery][gallery2]", "alt": "An inline gallery", "ref": "gallery2"}],
" Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet."
],
// settings
$std-n-cols: 12
$std-col-width: 54
$std-gutter-width: 30
// calculated constants
$std-page-width: ($std-n-cols * $std-col-width) + (($std-n-cols - 1) * $std-gutter-width)
@function column-width($n-cols, $col-width:$std-col-width, $gutter-width:$std-col-gutter)
$column-widths: $n-cols * $col-width
@alexcabrera
alexcabrera / gunicorn.conf.py
Created December 11, 2011 19:55
Django project deployment with SSL
bind = "unix:///tmp/project.sock"
pidfile = "/tmp/project.pid"
workers = 1
timeout = 90
@alexcabrera
alexcabrera / gist:1461646
Created December 11, 2011 17:20
/etc/supervisor/conf.d/<project_name>.conf
[program:<project_name>]
command=/home/deploy/.virtualenvs/<project_name>/bin/gunicorn_django -c deploy/gunicorn.conf.py
directory=/home/deploy/<project_name>/<project_name>
user=www-data
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/<project_name>.log