These patches provide basic support for the Bootstrap grid system in Internet Explorer 6. The JavaScript code requires jQuery.
Feel free to fork & improve.
/* WysiHat - WYSIWYG JavaScript framework, version 0.2.1 | |
* (c) 2008-2010 Joshua Peek | |
* | |
* WysiHat is freely distributable under the terms of an MIT-style license. | |
*--------------------------------------------------------------------------*/ | |
(function (window) { | |
var WysiHat = {}; |
// Just append `pastecode` to your controls | |
(function($) { | |
$.cleditor.buttons.pastecode = { | |
name: "pastecode", | |
image: "", | |
title: "Code", | |
command: "inserthtml", | |
popupName: "pastecode", | |
popupClass: "cleditorPrompt", | |
popupContent: "Paste the code:<br /><textarea cols='40' rows='3'></textarea><br /><input type='button' value='Ok' />", |
// articles per page | |
var limit = 10; | |
// pagination middleware function sets some | |
// local view variables that any view can use | |
function pagination(req, res, next) { | |
var page = parseInt(req.params.page) || 1, | |
num = page * limit; | |
db.articles.count(function(err, total) { | |
res.local("total", total); |
from scrapy import log | |
from scrapy.item import Item | |
from scrapy.http import Request | |
from scrapy.contrib.spiders import XMLFeedSpider | |
def NextURL(): | |
""" | |
Generate a list of URLs to crawl. You can query a database or come up with some other means | |
Note that if you generate URLs to crawl from a scraped URL then you're better of using a |
These patches provide basic support for the Bootstrap grid system in Internet Explorer 6. The JavaScript code requires jQuery.
Feel free to fork & improve.
import urllib2 | |
def xiami_decode(s): | |
s = s.strip() | |
if not s: | |
return False | |
result = [] | |
line = int(s[0]) | |
rows = len(s[1:]) / line | |
extra = len(s[1:]) % line |
王 | |
江 | |
周 | |
胡 | |
刘 | |
李 | |
吴 | |
毛 | |
温 | |
习 |
({:username "imakewebthings", | |
:name "Caleb Troughton", | |
:language "JavaScript", | |
:score 5476.8} | |
{:username "flyerhzm", | |
:name "Richard Huang", | |
:language "Ruby", | |
:score 2776.2} | |
{:username "fredwu", | |
:name "Fred Wu", |
// requirejs config in main.js | |
require.config({ | |
paths: { | |
jquery: 'components/jquery/jquery', | |
es5shim: 'components/es5-shim/es5-shim', | |
es5sham: 'components/es5-shim/es5-sham' | |
}, | |
map: { | |
'*': { | |
'flight/component': 'components/flight/lib/component', |
Lets look at how Facades work in Laravel 4 by investigating the flow of one of the facaded classes: URL. As in <?=URL::route('news')?>
.
As you'll see in the summary, this isn't exactly described in the procedural order your app is executed. But I think it serves to explain what's going on.
The app config has an aliases
array. In there is: 'URL' => 'Illuminate\Support\Facades\URL'
. If you look up that class, you'll see it just has this: protected static function getFacadeAccessor() { return 'url'; }
and that it inherits from Illuminate\Support\Facades\Facade
. We'll get back to this later.
Lets now turn to how the app boots up. The /vendor/laravel/framework/src/Illuminate/Foundation/start.php bootstrap file calls registerAliasLoader()
on an instance of Illuminate\Foundation\Application
.