Skip to content

Instantly share code, notes, and snippets.

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 / 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
@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: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 / 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.
<% 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: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 %>
@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 / basic_authenticate.rb
Created November 6, 2013 00:29
Rails 4 Basic Auth via ENV variable. Add this to your ApplicationController. Set the BASIC_AUTH ENV variable to enable.
before_filter :authenticate
protected
def authenticate
return true unless ENV['BASIC_AUTH']
authenticate_or_request_with_http_basic do |username, password|
username == "" && password == ENV['BASIC_AUTH']
end
end
@alexbaldwin
alexbaldwin / config.ru
Last active December 28, 2015 12:59
When using Middleman http://middlemanapp.com and HF&J http://typography.com together, the production checks fail. Use this Rack middleware to fix it. Code via @croaky.
require 'lib/rack_typography'
use Rack::Typography