Skip to content

Instantly share code, notes, and snippets.

@alexbaldwin
alexbaldwin / mantia-colors.scss
Created July 29, 2013 23:42
Colors based on Louie Mantia's iOS7 color scheme – http://dribbble.com/shots/1118715-Colors
$red: rgb(255,87,32);
$red-alt: rgb(255,28,60);
$orange: rgb(255, 192, 65);
$orange-alt: rgb(255, 149, 0);
$yellow: rgb(255,239,65);
$yellow-alt: rgb(255,192,1);
$green: rgb(162, 235, 61);
@alexbaldwin
alexbaldwin / gist:5548993
Created May 9, 2013 17:17
Middleman Blog Twitter card integration
<% if current_article %>
<title><%= "#{current_article.title}" %></title>
<meta name="twitter:card" content="summary">
<meta property="twitter:creator" content="@alexbaldwin">
<meta name="twitter:title" content="<%= truncate(current_article.title, length: 70) %>">
<meta name="twitter:image" content="<%= "#{current_article.data.image}" %>">
<meta name="twitter:description" content="<%= truncate(strip_tags(current_article.summary), length: 200) %>">
<meta name="twitter:domain" content="<%= "http://www.alexbaldwin.com#{current_article.url}" %>">
<% else %>
<% base_url = "http://youdomain.com/" %>
<% pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) } %>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<% pages.each do |p| %>
<url>
<loc><%= base_url + p.destination_path.gsub('index.html','') %></loc>
<% if priority = p.metadata[:page]['priority'] %>
<priority><%= priority %> </priority>
<% end %>
@alexbaldwin
alexbaldwin / gist:5073873
Created March 3, 2013 00:18
Email guide
Subject line
[Annotation] Type: What? Who? Where? When?
Ex. [URGENT] Todo: Fill out direct deposit by tomorrow to get paid
* Brevity, write only what's needed for completion.
@alexbaldwin
alexbaldwin / gist:5044309
Created February 27, 2013 02:06
trouble
[~/Desktop] ffmpeg -loop 1 -r 1 -shortest -y -i natalie.png -i tiesto.mp3 -acodec copy ouput.mp4
zsh: correct 'ouput.mp4' to 'output.mp4' [nyae]? y
ffmpeg version 1.1.3 Copyright (c) 2000-2013 the FFmpeg developers
built on Feb 25 2013 14:50:20 with Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/1.1.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 86.100 / 54. 86.100
libavformat 54. 59.106 / 54. 59.106
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
@alexbaldwin
alexbaldwin / screenshot dotfile
Created February 14, 2013 18:24
Change your screenshot directory in OSX
Replace '~/the/folder/you/want' with where your screenshots should go.
$ defaults write com.apple.screencapture location ~/the/folder/you/want
Make it work
$ killall SystemUIServer
@alexbaldwin
alexbaldwin / gist:4725285
Created February 6, 2013 19:56
Install IE Virtual boxes for 8, 9, 10
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="8 9 10" bash
agrant@precise64:~$ tail /var/log/syslog
Sep 13 02:04:35 precise64 commerce: exception 'Ergo_Http_Error_InternalServerError' with message '{"code":500,"message":"Failed to fulfill transaction 611219, caught exception with message \"pheasant error: [1146: Table 'contests.contestdraftndaattachment' doesn't exist] in adodb_throw(\n\t\t\tSELECT\n\t\t\t\tcontestdraftndaattachment.*\n\t\t\tFROM\n\t\t\t\tcontests.attachment attachment\n\t\t\tINNER JOIN\n\t\t\t\tcontests.contestdraftndaattachment contestdraftndaattachment USING (attachmentid)\n\t\t\t where draftid = '1564948' and isdeleted = 0, )\n\"","file":"\/home\/vagrant\/contests\/controllers\/FulfillmentController.php","line":312,"trace":[{"file":"\/home\/vagrant\/contests\/controllers\/FulfillmentController.php","line":128,"function":"_launchV4","class":"FulfillmentController"},{"file":"\/home\/vagrant\/contests\/controllers\/FulfillmentController.php","line":68,"function":"_fulfill","class":"FulfillmentController"},{"function":"fulfillTransactionCallback","cl
@alexbaldwin
alexbaldwin / ms-scale
Created September 7, 2012 20:35
Modular Scale Demo for Rebecca
@charset "utf-8";
@import "compass";
@import "compass/reset";
@import "modular-scale";
$ratio: golden();
$base-size: 1rem;
$text-color:rgb(50,60,50);
html {
@alexbaldwin
alexbaldwin / gist:3409585
Created August 21, 2012 00:09
Blue Steel
header {
$bg: rgb(13, 100, 159);
border-top: 1px solid lighten($bg, 10%);
border-bottom: 1px solid darken($bg, 10%);
@include linear-gradient($bg, darken($bg, 5%));
h4 {
color: #fff;
text-shadow: 0 1px rgba(0,0,0,.3);
}
}