Skip to content

Instantly share code, notes, and snippets.

View carlcalderon's full-sized avatar

Carl Calderon carlcalderon

  • Stockholm, Sweden
View GitHub Profile
# Disable press and hold (i.e. Enables key repetition)
defaults write -g ApplePressAndHoldEnabled -bool false
# Disable mouse scaling (i.e. Removes mouse acceleration)
defaults write .GlobalPreferences com.apple.mouse.scaling -1
# Disable creation of metadata (no more .DS_Store)
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Disable "Downloaded from the Internet" dialog
@carlcalderon
carlcalderon / normalize-fonts.css
Created March 12, 2014 14:20
Normalized font-rendering in common browsers
/*
There are duplicate properties that seems to behave differently pending on browser version (see -moz-font-smoothing).
This is the most consistent I've found so far between vendors.
Please fork and improve!
*/
body {
-webkit-text-rendering: optimizeLegibility;
-moz-text-rendering: optimizeLegibility;
-ms-text-rendering: optimizeLegibility;
@carlcalderon
carlcalderon / gist:3912567
Created October 18, 2012 15:28 — forked from paulirish/gist:3910471
page visibility API : tribulations with prefixes
// this is the least sucky way i could think of to
// detect and deal with a cross-browser impl of the page visibility api
// forks welcome.
function getHiddenProp() {
if ('hidden' in document) return 'hidden';
var prefixes = ['webkit','moz','ms','o'],
len = prefixes.length,
@carlcalderon
carlcalderon / include_me.as
Created January 27, 2012 09:14
Bitwise options in practice (actionscript)
/*
AS3 BITWISE OPTIONS IN PRACTICE
Ever wondered how the Array.sort() does the trick?
*/
const BUY : int = 0x1; // 1
const SELL : int = 0x2; // 2
const BAKE : int = 0x4; // 4
const MUFFINS : int = 0x8; // 8
const CAKE : int = 0x10; // 16