Skip to content

Instantly share code, notes, and snippets.

@alexdunae
alexdunae / smushit.sh
Created October 15, 2009 16:45
Image optimization with a home-rolled Smush.it
#!/bin/bash
#
# Home-rolled Smush.it, by Alex Dunae (http://dialect.ca).
#
# N.B. This script works for me; it may not work for you.
# Since it overwrites your images with the optimized version, you should
# backup your files before running this script and do a trial run before
# getting too excited. This is your disclaimer.
#
# Uses jpegtran (http://jpegclub.org/jpegtran/), part of libjpeg,
@nathansmith
nathansmith / html_reset.css
Created January 28, 2010 00:02
Reset for HTML4 / HTML5
/* `XHTML, HTML4, HTML5 Reset
----------------------------------------------------------------------------------------------------*/
a,
abbr,
acronym,
address,
applet,
article,
aside,
@Aeon
Aeon / 960gs.less
Created March 1, 2010 07:41 — forked from Artanis/960gs.less
LessCSS and 960gs don't play well together normally. Here's the definitions for 960gs to let LessCSS work with it. Looks like we can pull all grid data out of the HTML.
/**
* A LessCSS version of the 960 Grid System
*
* http://lesscss.org/
* http://960.gs/
*/
/*********************************************************************
* Settings *
*********************************************************************/
@romac
romac / Increment Digits In Selected Text.php
Created June 17, 2010 11:50
Two Commands for TextMate which allows you to increment any digits/numbers in the selected text.
#!/usr/bin/env php
<?php
$text = $_ENV[ 'TM_SELECTED_TEXT' ];
print preg_replace_callback(
'/(\d)/',
function( $matches )
{
return $matches[ 0 ] + 1;
#!/usr/bin/env ruby
# Usage: tp2md.rb filename.taskpaper > output.md
# Updated 2025-03-19
# - Fix block quote indentation
# - use GFM-style - [ ] markers
# - convert @tags to #tags
# - <self-link> bare urls
# - Accept input piped on STDIN
if $stdin.stat.size.positive?

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@2shortplanks
2shortplanks / Evernote and OmniFocus integration
Created February 7, 2011 10:32
Evernote and OmniFocus integration
-- Find the note in omnifocus for the current project / folder
-- (or create a new one) and display it.
-- Created by Mark Fowler ([email protected])
-- Help from http://veritrope.com/code/search-evernote-for-notes-containing-link-to-selected-omnifocus-item/
-- on getting the name / url for the current omnifocus item
tell front window of application "OmniFocus"
try
@cloudhead
cloudhead / gist:967157
Created May 11, 2011 19:38
LESS v1.1.0 - What's new

LESS v1.1.0 - What's new

@arguments special variable:

  .box-shadow () { -webkit-box-shadow: @arguments }

string interpolation:

content: "hello @{var}"; // replaced with value of @var

@kopischke
kopischke / markdown2evernote.rb
Created June 5, 2011 16:57
OS X service scripts
#!/usr/bin/env ruby -wKU
# Adapted from Brett Terpstra’s original “Markdown to Evernote” service (http://brettterpstra.com/a-better-os-x-system-service-for-evernote-notes-with-multimarkdown/)
# Martin Kopischke 2011 – License: Creative Commons Attribution Share-Alike (CC BY-SA) 3.0 Unported (http://creativecommons.org/licenses/by-sa/3.0/)
# Changes: – create only one Evernote note per (Multi)Markdown input passed (instead of one per line)
# – do not choke on shell escape characters (use Tempfile instead of shell pipe for osascript)
# – default to MultiMarkdown 3 executable (instead of MMD 2 Perl script)
# – make smart typography processing optional (set SMARTY to 'false' to bypass processing;
# note smart typography cannot be disabled in MMD 3.0 and 3.0.1
# – handle both smart typography processing scripts (ie. SmartyPants.pl)
@iansoper
iansoper / favicon.html
Created June 22, 2011 13:54
HTML Favicon Link usage
<!-- Example taken from SimpleNote http://simplenoteapp.com/ -->
<link rel="icon" type="image/png" sizes="16x16" href="/favicon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/Simplenote-32px.png" />
<link rel="icon" type="image/png" sizes="64x64" href="/Simplenote-64px.png" />
<link rel="icon" type="image/png" sizes="256x256" href="/Simplenote-256px.png" />
<link rel="icon" type="image/png" sizes="512x512" href="/Simplenote-512px.png" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />