Skip to content

Instantly share code, notes, and snippets.

View hqman's full-sized avatar
🏊‍♂️
Focusing

Kai Wang hqman

🏊‍♂️
Focusing
View GitHub Profile
var down = "touchup" in window ? "touchup" : "click";
var abstractView = Backbone.View.extend({
// we don't want both click and touch handlers
// delegated on touch-enabled devices
events: function () {
"click .toggler" : "foo",
"touchup .toggler" : "bar"
},
initialize: function () {
@hqman
hqman / example.html
Created November 18, 2012 01:08 — forked from kylebarrow/example.html
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@hqman
hqman / webkit_inspector_font_size.sh
Created August 6, 2012 14:05 — forked from cowboy/webkit_inspector_font_size.sh
Increase WebKit Inspector's font size (probably will need to re-run after updates)
#!/bin/bash
sudo find '/Applications/Google Chrome.app' \
\( -name inspector.css -or -name devTools.css \) \
-exec sh -c 'cat >> $1 <<WAT
/* Added on `date` */
#drawer .monospace,
#drawer .source-code {
font-size: 18px !important;
@hqman
hqman / gist:3074740
Created July 9, 2012 07:08 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
try:
from recaptcha.client import captcha
from pylons import request, config
class RecaptchaValidator(Schema):
'''
Validates ReCAPTCHA against their web service
'''
@hqman
hqman / gunicorn_lighttpd.conf
Created January 11, 2012 03:03 — forked from thomasbilk/gunicorn_lighttpd.conf
gunicorn lighttpd conf file
server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_extforward",
"mod_rewrite",
#"mod_fastcgi",
"mod_proxy",
"mod_redirect" )