This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you don't have Homebrew installed, you should. Do this. | |
/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)" | |
# Install DNSMasq from Homebrew | |
brew install dnsmasq | |
# Create a directory for virtual hosts files | |
mkdir -p /usr/local/etc/dnsmasq.d | |
# Create a config for DNSMasq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reset scaling on iPads on orientation change. author: @axolx | |
if (navigator.userAgent.match(/iPad/i)) { | |
$(window).bind('orientationchange', function(event) { | |
if (window.orientation == 90 || window.orientation == -90 || window.orientation == 270) { | |
$('meta[name="viewport"]').attr('content', 'height=device-width,width=device-height,initial-scale=1.0,maximum-scale=1.0'); | |
$(window).resize(); | |
} else { | |
$('meta[name="viewport"]').attr('content', 'height=device-height,width=device-width,initial-scale=0.8,maximum-scale=0.8'); | |
$(window).resize(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# SSD 优化脚本. | |
# | |
# 用法: | |
# 保存该脚本为 ssd.sh | |
# 在终端里运行 sudo ssh.sh | |
# 关闭 Sudden motion sensor | |
# SMS 用于笔记本在突然移动时通知硬盘碰头复位, 以保护机械硬盘不受损伤, 对于固态硬盘没有用处. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<i class="macbook"></i> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<i class="macbook"></i> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<i class="macbook"></i> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.ontouchmove = function(event){ | |
event.preventDefault(); | |
} | |
#http://stackoverflow.com/questions/7768269/ipad-safari-disable-scrolling-and-bounce-effect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |