Skip to content

Instantly share code, notes, and snippets.

View alexcabrera's full-sized avatar

Alex Cabrera alexcabrera

View GitHub Profile
@alexcabrera
alexcabrera / .bash_helpers
Created February 23, 2015 03:13
Your `~/.bash_helpers` and `~/.bash_profile` files should include the following lines; add the `.termconfig` file to directories you'd like to configure.
# Name iTerm2 tabs
function nametab {
echo -ne "\033]0;"$*"\007";
}
@alexcabrera
alexcabrera / gitolite.yml
Created October 24, 2014 16:15
Ansible tasks for provisioning a multi-admin gitolite setup
---
- name: add git user
user: name={{ git_user }} home={{ git_dir }} generate_ssh_key=yes state=present
- name: install apt pacakges
apt: pkg={{ item }} state=latest
with_items:
- git-core
- gitolite3
@alexcabrera
alexcabrera / gitolite.yml
Created October 24, 2014 03:52
Set up gitolite with Ansible
---
- name: add git user
user: name={{ git_user }} home={{ git_dir }} generate_ssh_key=yes state=present
- name: install git
apt: pkg=git-core state=latest
- name: install gitolite
apt: pkg=gitolite3 state=latest
@alexcabrera
alexcabrera / disableMapTouch.coffee
Created November 5, 2013 20:54
Disable all touch events from a leaflet.js map
disableMapTouch = (map) ->
map.scrollWheelZoom.disable()
map.dragging.disable()
map.touchZoom.disable()
map.doubleClickZoom.disable()
map.boxZoom.disable()
map.keyboard.disable()
if map.tap
map.tap.disable()
@alexcabrera
alexcabrera / 0_reuse_code.js
Created November 3, 2013 16:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@alexcabrera
alexcabrera / sessiontest.py
Created January 29, 2013 05:20
Example of using beaker sessions with bottle
import bottle
from beaker.middleware import SessionMiddleware
session_opts = {
'session.type': 'memory',
'session.cookie_expires': 300,
'session.auto': True
}
app = SessionMiddleware(bottle.app(), session_opts)
@alexcabrera
alexcabrera / Guardfile
Created November 21, 2012 16:58
guard-livereload and proto
guard 'livereload' do
watch(%r{.+\.(coffee|styl|jade)$})
end
@alexcabrera
alexcabrera / reset.css
Created October 22, 2012 04:59
CSS: HTML5 Reset
/*
html5doctor.com Reset Stylesheet
v1.6.1
Last Updated: 2010-09-17
Author: Richard Clark - http://richclarkdesign.com
Twitter: @rich_clark
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
@alexcabrera
alexcabrera / tm2-markdown.rb
Created October 19, 2012 04:31
How TM2 handles language grammars
{ patterns = ( { include = '#block'; } );
repository = {
block = {
patterns = (
{ include = '#separator'; },
{ include = '#heading'; },
{ include = '#blockquote'; },
{ include = '#lists'; },
{ include = '#raw_block'; },
{ include = '#link-def'; },
h1 This is my own custom Marquee page
ul
li page 1
li page 2
li page 3