Skip to content

Instantly share code, notes, and snippets.

@azizmb
azizmb / bootstrap.validator.overrides.js
Created April 25, 2012 18:15
Bootstrap Validator Overrides
$.extend($.validator.messages, {
required: "can't be blank",
remote: 'needs to get fixed',
email: 'is an invalid email address',
url: 'is not a valid URL',
date: 'is not a valid date',
dateISO: 'is not a valid date (ISO)',
number: 'is not a valid number',
digits: 'needs to be digits',
creditcard: 'is not a valid credit card number',
@azizmb
azizmb / bootstrap_helper.rb
Created April 24, 2012 16:18 — forked from thatfunkymunki/application_helper.rb
Make will_paginate generate HTML that bootstrap.less will render nicely, fixed for will_paginate 3.0.2
def bootstrap_paginate(pages, options={})
options.reverse_merge!(
:class => 'pagination',
:renderer => BootstrapLinkRenderer,
:previous_label => '←'.html_safe,
:next_label => '→'.html_safe
)
will_paginate(pages, options)
end
@azizmb
azizmb / album_scrape.py
Created February 24, 2012 04:22
Script to download all photos from an album in imgur
from BeautifulSoup import BeautifulSoup
import requests
import os
album_url = "http://imgur.com/a/TYfWa/all/hot/day/page/%d?scrolled"
pages = 3
directory = "heroes"
posts_list = []
@azizmb
azizmb / installing_pil.md
Last active August 29, 2015 14:00
PIL dependencies

Installing libs and fixing lib links

build=`uname --hardware-platform`
apt-get install python-dev libjpeg62 libjpeg-dev libpng12-0 libpng-dev libfreetype6-dev
ln -s /usr/lib/${build}-linux-gnu/libjpeg.so /usr/lib
ln -s /usr/lib/${build}-linux-gnu/libz.so /usr/lib