most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
sub, sup { | |
/* Specified in % so that the sup/sup is the | |
right size relative to the surrounding text */ | |
font-size: 75%; | |
/* Zero out the line-height so that it doesn't | |
interfere with the positioning that follows */ | |
line-height: 0; | |
/* Where the magic happens: makes all browsers position |
/* ---------------------------------------------------------- */ | |
/* */ | |
/* A media query that captures: */ | |
/* */ | |
/* - Retina iOS devices */ | |
/* - Retina Macs running Safari */ | |
/* - High DPI Windows PCs running IE 8 and above */ | |
/* - Low DPI Windows PCs running IE, zoomed in */ | |
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */ | |
/* - Android hdpi devices and above */ |
Every time I start a new project, I want to pull in a log
function that allows the same functionality as the console.log
, including the full functionality of the Console API.
There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log
was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.
This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:
$(function() { | |
var $el = $('.parallax-background'); | |
$(window).on('scroll', function () { | |
var scroll = $(document).scrollTop(); | |
$el.css({ | |
'background-position':'50% '+(-.4*scroll)+'px' | |
}); | |
}); | |
}); |
<?php | |
// Include the database connection info | |
require_once("path/to/dbInfo.inc"); | |
/* | |
* Database methods | |
*/ | |
function db_select($sql, $data) | |
{ |
/* ------------------------------------------------------------- | |
# Variables | |
------------------------------------------------------------- */ | |
$site_maxwidth: 72rem; // Maximum width the entire site should not exceed | |
$site_maxwidth-text: 40rem; // Maximum width the main content text should not exceed | |
$spacing_horizontal: 1rem; // General horizontal padding | |
/* ------------------------------------------------------------- | |
# General Styles |