Skip to content

Instantly share code, notes, and snippets.

Aziz M. Bookwala azizmb

Block or report user

Report or block azizmb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@azizmb
azizmb / _notification.html.haml
Created Apr 25, 2012
Bootstrap flash messages
View _notification.html.haml
- flash.each do |type, message|
.alert.alert-block{:class => "alert-#{bootstrap_alert_type(type)}" }
%h4.alert-heading #{ bootstrap_alert_type(type).titleize }!
= message
@azizmb
azizmb / bootstrap_helper.rb
Created Apr 24, 2012 — forked from thatfunkymunki/application_helper.rb
Make will_paginate generate HTML that bootstrap.less will render nicely, fixed for will_paginate 3.0.2
View bootstrap_helper.rb
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 Feb 24, 2012
Script to download all photos from an album in imgur
View album_scrape.py
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 / message_queue_pipeline.py
Created Jan 7, 2012
Scrapy pipeline to enque scraped items to message queue using carrot
View message_queue_pipeline.py
from scrapy.xlib.pydispatch import dispatcher
from scrapy import signals
from scrapy.exceptions import DropItem
from scrapy.utils.serialize import ScrapyJSONEncoder
from carrot.connection import BrokerConnection
from carrot.messaging import Publisher
from twisted.internet.threads import deferToThread
You can’t perform that action at this time.