Skip to content

Instantly share code, notes, and snippets.

@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">
#!/bin/bash
cat .gitignore | egrep -v "^#|^$" | while read line; do
if [ -n "$line" ]; then
OLD_IFS=$IFS; IFS=""
for ignored_file in $( git ls-files "$line" ); do
git rm --cached "$ignored_file"
done
IFS=$OLD_IFS
fi
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):
"""