Skip to content

Instantly share code, notes, and snippets.

@markusfisch
markusfisch / gist:3136580
Created July 18, 2012 14:40
Pan and zoom/pinch images with MOAI
------------------------------------------------------------------------------
-- local members
------------------------------------------------------------------------------
local devWidth, devHeight = 0, 0
local viewport = nil
local layer = nil
local quad = nil
local prop = nil
local imgWidth, imgHeight = 0, 0
@ryankirkman
ryankirkman / jquery_mobile_dynamic_theme_refresh.html
Created August 1, 2011 07:16
jQuery Mobile - Dynamically / Programatically Update Page Theme
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="dns-prefetch" href="//code.jquery.com">
<!-- Ensure we set a viewport so everything scales appropriately on mobile devices. -->
<meta name="viewport" content="width=device-width, initial-scale=1">
import re
# Some mobile browsers which look like desktop browsers.
RE_MOBILE = re.compile(r"(iphone|ipod|blackberry|android|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):
"""