Skip to content

Instantly share code, notes, and snippets.

View intellecat's full-sized avatar
🌴
On vacation

geecat intellecat

🌴
On vacation
  • CatЯun
  • NZ
  • 22:48 (UTC +12:00)
View GitHub Profile
@dndx
dndx / xiami_decode.py
Created April 29, 2012 14:42
Xiami URL Decoder
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
@gpluess
gpluess / README.md
Created February 22, 2012 12:52
IE6 patch for the Twitter Bootstrap grid system

These patches provide basic support for the Bootstrap grid system in Internet Explorer 6. The JavaScript code requires jQuery.

Feel free to fork & improve.

@osiloke
osiloke / gist:1138798
Created August 11, 2011 02:38 — forked from saidimu/gist:1024207
Generating URLs to crawl from outside a Scrapy spider
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
@xjamundx
xjamundx / express-pagination.js
Created April 19, 2011 05:28
sample pagination using express route-specific middleware
// 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);
@stas
stas / jquery.cleditor.pastecode.js
Created February 21, 2011 16:16
CLEditor pastecode (pre/code) plugin
// 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' />",
@jankuca
jankuca / wysihat.js
Created January 17, 2011 14:05
Modified WysiHat v0.2.1; not forked the original repository because rake is required
/* 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 = {};