Skip to content

Instantly share code, notes, and snippets.

View claytron's full-sized avatar
😎
My future is so bright.

Clayton Parker claytron

😎
My future is so bright.
View GitHub Profile
@uasi
uasi / vim.rb
Created November 30, 2010 16:46
Vim formula for Homebrew (EDIT: recent versions of official Homebrew distribution includes one)
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.682'
def features; %w(tiny small normal big huge) end
@tomster
tomster / git-dropbox
Created January 1, 2011 15:40
Create a symlink of the current .git inside your Dropbox, now all your local commits will automatically be backed up to Dropbox (without your dropbox being littered with development cruft, like temporary build files)
#!/usr/bin/env python
# encoding: utf-8
""" Create a symlink of the current .git inside your Dropbox, now all your
local commits will automatically be backed up to Dropbox (without your dropbox
being littered with development cruft, like temporary build files)
"""
from os import getcwd, path, mkdir, symlink, chdir
@cosmin
cosmin / sendit.py
Created January 9, 2011 19:40
Easily send an email attachment from the command line
import os, sys
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email.Utils import formatdate
from email import Encoders
SMTP_SERVER='localhost'
@tyru
tyru / .vimrc
Created January 22, 2011 15:52
" Automatic `:!chmod +x %`.
command! -bar DisableAutoChmod let b:disable_auto_chmod = 1
autocmd BufWritePost * call s:auto_chmod()
function! s:auto_chmod()
if !exists('b:disable_auto_chmod')
\ && getfperm(expand('%'))[2] !=# 'x'
\ && getline(1) =~# '^#!'
!chmod +x %
endif
endfunction
@dnouri
dnouri / cache.py
Created February 10, 2011 15:39
A 136 line alternative to plone.{app.,}caching that includes policy
import datetime
import Acquisition
from zope import interface
from zope import component
import plone.postpublicationhook.interfaces
#from collective.skinny.interfaces import IPublicLayer
@iamFIREcracker
iamFIREcracker / .Xmodmap
Created April 10, 2011 11:47
A snippet for Xmodmap that will teach you to use the correct shift keys.
remove shift = Shift_R
remove lock = Caps_Lock
remove mod5 = Mode_switch
add control = Caps_Lock
add mod3 = Mode_switch
keysym Shift_R = Mode_switch
@weakish
weakish / README.markdown
Last active December 18, 2023 05:58
#Solarized themes (dark and light) for #roxterm.
@carljm
carljm / postactivate
Created July 12, 2011 18:21
Yo dawg, I heard you like Ruby...
#!/bin/bash
# This hook is run after every virtualenv is activated.
export OLD_GEM_HOME=$GEM_HOME
export GEM_HOME=$VIRTUAL_ENV/gems/
export GEM_PATH=
export PATH=$VIRTUAL_ENV/gems/bin:$PATH
@g-eorge
g-eorge / gist:1193546
Created September 4, 2011 21:35
Patch to get rid of favicons on the Chromium bookmark bar
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index ecf841a..84f9152 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -1537,7 +1537,7 @@ void RecordAppLaunch(Profile* profile, GURL url) {
// Return an autoreleased NSCell suitable for a bookmark button.
// TODO(jrg): move much of the cell config into the BookmarkButtonCell class.
- (BookmarkButtonCell*)cellForBookmarkNode:(const BookmarkNode*)node {
- NSImage* image = node ? [self faviconForNode:node] : nil;
+ NSImage* image = nil; // Hack to never add a favicon! // node ? [self faviconForNode:node] : nil;
@witsch
witsch / .pdbrc
Created September 23, 2011 18:21
Previewing `browser.contents` in Pdb
# 'preview' support for browser tests
alias preview import os, tempfile; out = tempfile.NamedTemporaryFile(mode='w', suffix='.html'); print >> out, browser.contents; out.flush(); _ = os.system("open '%s'" % out.name)