Skip to content

Instantly share code, notes, and snippets.

View EtienneLem's full-sized avatar

Etienne Lemay EtienneLem

View GitHub Profile
@madrobby
madrobby / gist:2997187
Created June 26, 2012 17:13
The ultimate media query to rule them all ("all" being high DPI/"Retina" screens)
@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 */
}
@rafbm
rafbm / .gitconfig
Created February 6, 2012 16:16
Sane aliases for `git reset`
[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!)
@mislav
mislav / aprompt.png
Last active February 11, 2024 06:40
My zsh prompt. No oh-my-zsh needed
aprompt.png
@scottjehl
scottjehl / fixorientationzoom.js
Created January 6, 2012 00:27
Fix iOS Orientation Change Zoom Bug
/*
NOTE!!!!
The most updated version of this code is here:
https://github.com/scottjehl/iOS-Orientationchange-Fix
@madrobby
madrobby / gist:1362093
Created November 13, 2011 13:04
Force rendering a DOM element when Webkit is acting up
forceRerenderOnWebkit: ->
@el.parentNode.style.cssText += ';-webkit-transform:rotateZ(0deg)'
@el.parentNode.offsetHeight
@el.parentNode.style.cssText += ';-webkit-transform:none'
@RandomEtc
RandomEtc / 1-make-key
Created September 16, 2011 16:35
generating SSL keys and Certificate Signing Requests for Heroku / Nginx / RapidSSL
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
@rafbm
rafbm / css-compressor.js
Created August 27, 2011 19:26
CSS compressor
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
}