Skip to content

Instantly share code, notes, and snippets.

View jimmydo's full-sized avatar

Jimmy Do jimmydo

View GitHub Profile
import re
# Some mobile browsers which look like desktop browsers.
RE_MOBILE = re.compile(r"(iphone|ipod|blackberry|android.+mobile|palm|windows\s+ce)", re.I)
RE_DESKTOP = re.compile(r"(windows|linux|os\s+[x9]|solaris|bsd)", re.I)
RE_BOT = re.compile(r"(spider|crawl|slurp|bot)")
def is_desktop(user_agent):
"""
@jimmydo
jimmydo / jquery.textchange.js
Created December 18, 2010 00:22 — forked from mkelly12/jquery.textchange.js
Make val() trigger change event
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {