Skip to content

Instantly share code, notes, and snippets.

@trent-boyd
trent-boyd / home-end
Created January 23, 2014 17:27
Home + End Keys Remapping
{
/* Remap Home / End keys to be correct */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
"^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Ctrl + End */
@trent-boyd
trent-boyd / media-breakpoints.css
Last active December 21, 2015 09:19
Media Breakpoints
body::before {
background-color: white;
color: black;
content: '';
padding: 5px;
position: absolute;
z-index: 1000000;
}
@media only screen and (min-width: 600px) {
@trent-boyd
trent-boyd / font-mixin.css
Last active December 13, 2015 21:48
LESS: Quick & Dirty @font-face Mixin
.font(@name, @file, @style: normal, @weight: normal) {
@font-face {
font-family: @name;
src: url('../fonts/@{file}.eot');
src: url('../fonts/@{file}.eot?#iefix') format('embedded-opentype'),
url('../fonts/@{file}.svg') format('svg'),
url('../fonts/@{file}.ttf') format('truetype');
font-style: @style;
font-weight: @weight;
}
@trent-boyd
trent-boyd / arrange-windows.applescript
Created February 9, 2013 01:24
Applescript: Arrange Windows w/ Moom
-- Move to Space 1
tell application "System Events" to keystroke (key code 105)
delay 1
tell application "Moom" to arrange windows according to snapshot named "Development Panel"
-- Move to Space 2
tell application "System Events" to keystroke (key code 107)
delay 1
tell application "Moom" to arrange windows according to snapshot named "Communication Panel"
@trent-boyd
trent-boyd / morning-jams.applescript
Last active December 12, 2015 08:18
Applescript: Play 'Morning Jams' Playlist w/ Rdio
tell application "System Events"
-- Only runs if Rdio is running
if (name of processes) contains "Rdio" then
tell application "Rdio"
-- Shuffle it!
set shuffle to true
-- Plays 'Morning Jams' playlist
play source "p2265948"
end tell
end if
@trent-boyd
trent-boyd / less-saturate-fix.md
Created December 9, 2012 21:15
LESS: Proper Syntax for CSS3 "Saturate" Filter

What You Think Would Work

You'd think that the way LESS works, you could just make your own .saturate() function to handle all of your various vendor-specific CSS rules, like so:

.saturate(@pct) {
	filter: saturate(@pct);
	-webkit-filter: saturate(@pct);
	-moz-filter: saturate(@pct);
@trent-boyd
trent-boyd / countries-select.html
Created November 20, 2012 16:55
HTML: Countries in Select Element
<!--
NOTE: United States is first in this list, but if you want
to be nice and alphabetical about it, it should go
right under "United Kingdom" on line 234. :)
-->
<select name="Country">
<option value="United States" selected>United States</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
@trent-boyd
trent-boyd / states-select.html
Created November 20, 2012 16:38
HTML: US States in Select Element
<!-- Full State Name -->
<select name="State">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>