I create a little jQuery/Zepto “plugin” function:
$.fn.onClickOrTouch = (callback) ->
if window.ontouchend != undefined # insanely clever touch detection
this.each -> this._touchMoveCount = 0| var compressCSS = function(css) { | |
| return css.trim() | |
| .replace(/\s*([{}:;,>+~])\s*/g, '$1') // whitespace | |
| .replace(/;}/g, '}') // trailing semicolons | |
| .replace(/#(\w)\1(\w)\2(\w)\3\b/g, '#$1$2$3') // hex colors | |
| .replace(/(\[[^=]+=)("|')([^"'\s]+)(\2)(\])/g, '$1$3$5') // useless attribute selector quotes | |
| .replace(/\(('|")([^"'\s]+)(\1)\)/g, '($2)') // useless function quotes | |
| } |
| Key was generated using: | |
| tom% openssl genrsa -des3 -out example.com.key 2048 | |
| Generating RSA private key, 2048 bit long modulus | |
| ....+++ | |
| ..........................................................................................................................+++ | |
| e is 65537 (0x10001) | |
| Enter pass phrase for example.com.key: | |
| Verifying - Enter pass phrase for example.com.key: | |
| %tom |
| forceRerenderOnWebkit: -> | |
| @el.parentNode.style.cssText += ';-webkit-transform:rotateZ(0deg)' | |
| @el.parentNode.offsetHeight | |
| @el.parentNode.style.cssText += ';-webkit-transform:none' |
| /* | |
| NOTE!!!! | |
| The most updated version of this code is here: | |
| https://github.com/scottjehl/iOS-Orientationchange-Fix |
| [alias] | |
| unstage = reset HEAD # unstage | |
| clear = reset --hard HEAD # erase uncommited file edits (destructive!) | |
| uncommit = reset HEAD~1 # erase last commit but keeps related file edits | |
| rollback = reset --hard HEAD~1 # erase last commit and related file edits (destructive!) |
| @media (min--moz-device-pixel-ratio: 1.5), | |
| (-o-min-device-pixel-ratio: 3/2), | |
| (-webkit-min-device-pixel-ratio: 1.5), | |
| (min-device-pixel-ratio: 1.5), | |
| (min-resolution: 1.5dppx) { | |
| /* "retina" styles */ | |
| } |
| 1. Open terminal.app | |
| 2. Paste this command: defaults write NSGlobalDomain WebKitDeveloperExtras -bool true | |
| (credit: https://twitter.com/defaultswrite/status/220164244954554368) | |
| 3. Open Rdio.app | |
| 4. Right click and show the inspector panel | |
| 5. In the console section, paste this line: $("head").append('<link href="https://s3.amazonaws.com/simon-dev/css/rdio.css" rel="stylesheet" type="text/css">') |
| function isRetina(){ | |
| return (('devicePixelRatio' in window && devicePixelRatio > 1) || | |
| ('matchMedia' in window && matchMedia("(min-resolution:144dpi)").matches)) | |
| } |