This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- flash.each do |type, message| | |
.alert.alert-block{:class => "alert-#{bootstrap_alert_type(type)}" } | |
%h4.alert-heading #{ bootstrap_alert_type(type).titleize }! | |
= message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder