Skip to content

Instantly share code, notes, and snippets.

View garthhumphreys's full-sized avatar
🎯
Focusing

Garth Humphreys garthhumphreys

🎯
Focusing
View GitHub Profile
@tsabat
tsabat / zsh.md
Last active July 7, 2024 16:56
Getting oh-my-zsh to work in Ubuntu
@maraujop
maraujop / forms.py
Created February 15, 2012 19:04
django-crispy-forms bootstrap form example
# -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
class MessageForm(forms.Form):
text_input = forms.CharField()
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 7, 2024 07:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jpennell
jpennell / fabfile.py
Created September 18, 2012 01:15
Fabric fabfile for Django/Heroku App
from fabric.api import env, local, require
def deploy():
"""fab [environment] deploy"""
require('environment')
maintenance_on()
push()
syncdb()
migrate()
@championofblocks
championofblocks / wav-mp3
Last active May 1, 2024 12:49
Command line bash to convert all wav to mp3
for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done
@krciga22
krciga22 / ANF_StatefulMenu
Created March 3, 2013 18:43
Use this JavaScript class to quickly add css state to an html menu with a tag links. Once initiated, the class will look at all a tags within the main menu element specified and will append the class name 'selected' to the a tag representing the current page. *Please note this is not for ajax based menus.
/**
* Use this class to quickly add css state to an html menu with a tag links.
* Once initiated, the class will look at all a tags within the main menu element
* specified and will append *the class name 'selected' to the a tag representing
* the current page. Please note this is not for ajax based menus.
* @class ANF_StatefulMenu
* @author ANF.
* @example
// menu initiation script (requires jQuery to be loaded so place in your html code near the closing body tag)
@stvnwlsn
stvnwlsn / gist:5221087
Created March 22, 2013 13:04
Install Scrapy in virtualenv
# Work in progress
# Need to test in virtualbox
sudo apt-get install libxml2-dev libxslt-dev
sudo apt-get install python-lxml
virtualenv --distribute venv
source venv/bin/activate
@rachelbaker
rachelbaker / install-yeoman-osx.md
Last active June 24, 2024 14:48
Instructions for installing Node NPM and Yeoman on OSX
@thiagozs
thiagozs / openrtb-iab-category.md
Created September 27, 2013 17:30
IAB OpenRTB Category

###IAB1 Arts & Entertainment IAB1-1 Books & Literature
IAB1-2 Celebrity Fan/Gossip
IAB1-3 Fine Art
IAB1-4 Humor
IAB1-5 Movies
IAB1-6 Music
IAB1-7 Television

###IAB2 Automotive

@pennersr
pennersr / allauth_avatar.py
Last active June 18, 2020 22:27
Support for copying profile pictures into django-avatar was removed from django-allauth. This gist contains example code that you can drop into your own project in order to reinstate that functionality.
import urllib2
from django.template.defaultfilters import slugify
from django.core.files.base import ContentFile
from django.dispatch import receiver
from avatar.models import Avatar
from allauth.account.signals import user_signed_up