Skip to content

Instantly share code, notes, and snippets.

View imathis's full-sized avatar
🍽️
Hungry for biscuits.

Brandon Mathis imathis

🍽️
Hungry for biscuits.
View GitHub Profile
@imathis
imathis / apachectl fix
Created December 3, 2010 05:05
fix for allowing restarting apache via apachectl in OS X 10.5.6
`sudo apachectl restart` doesn't work in 10.5.6 you'll get this error:
/usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument
in OS X 10.5.6 Apple updated to Apache 2.2.15, which patched quite a few vulnerabilities (see http://support.apple.com/kb/HT4435) and also broke the apachectl script.
To get sorted, edit /usr/sbin/apachectl and replace line 82
ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`"
@imathis
imathis / 3d.scss
Created January 5, 2011 23:23 — forked from chriseppstein/3d.scss
@function shadow-3d($thickness-shadow-color, $splash-shadow-color, $thickness, $angle: 0) {
$shadows: compact();
@if unit($thickness) != px { @warn "$thickness must be passed as a pixel value, eg: 5px." };
@for $i from 1 through $thickness/1px {
$shadows: append($shadows, 0 1px * $i 0 adjust-color($thickness-shadow-color, $lightness: -3.3% * ($i - 1)));
}
@each $values in (
0 $thickness + 1px 1px 0.1,
0 0 $thickness + 5px 0.3,
0 abs($thickness - 2px) 5px 0.2,
@imathis
imathis / Open-Safari-URL-in-Chrome.scpt
Created March 14, 2011 19:37
Open Safari's foremost url in Google Chrome (useful for flash resistance)
(*
Opens current url of foremost safari window in Google Chrome.
Useful for flash resisters who prefer the Safari browser
Store in ~/Library/Scripts/Applications/Safari
Can be invoked via Launchbar, and other launchers.
*)
tell application "Safari"
activate
@imathis
imathis / test.diff
Created May 28, 2011 12:05
move along, just testing a syntax highlighter
@@ -590,7 +590,7 @@ class SpritesTest < Test::Unit::TestCase
it "should generate a sprite from nested folders" do
css = render <<-SCSS
- @import "nested/*.png";
+ @import "nested/**/*.png";
@include all-nested-sprites;
SCSS
assert_correct css, <<-CSS
@imathis
imathis / code_blocks.rb
Created June 15, 2011 16:04
Jekyll plugin to import code blocks from the filesystem for syntax highlighting
require 'pathname'
module Jekyll
class CodeBlockTag < Liquid::Tag
def initialize(tag_name, file, tokens)
super
@file = file.strip
end
@imathis
imathis / gist_tag.rb
Created June 15, 2011 17:58 — forked from chrisjacob/gist_tag.rb
A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
@imathis
imathis / Pullquote.css
Created June 19, 2011 02:52
Jekyll Pullquote plugin for Octopress
.has-pullquote:before {
/* Reset metrics. */
padding: 0;
border: none;
/* Content */
content: attr(data-pullquote);
/* Pull out to the right, modular scale based margins. */
float: right;
@imathis
imathis / gist:1104557
Created July 25, 2011 16:49
FIX for Lion's posix_spawn_ext.bundle: [BUG] Segmentation fault

The segfault problem with posix_spawn is indeed caused by Lion's compiler being LLVM and not GCC by default. However, when I installed RVM, the notes suggested that on Lion you need to add export CC=/usr/bin/gcc-4.2 to your shell startup file (.bashrc or .zshrc as appropriate). I did that, but it seems that's what caused problems: while ruby 1.9.2 needs you to use GCC to install it, using the same compiler for the gems apparently causes breakage.

First, you need to install XCode 4.x, which is now a free (though hefty!) download from the Mac App Store. Without that, you have no gcc, so you won't get anywhere ;-)

Next, what you need to do is clear out your rvm ruby and the associated gems (make sure you are cd'd into your octopress repository then do:

rvm remove ruby-1.9.2 --gems --archive

which will clear everything out so that you can start from scratch. Obviously, if you have other stuff you've installed for other purposes using RVM, be careful with this. If you previously had the export CC li

@imathis
imathis / gist:1147044
Created August 15, 2011 15:51 — forked from jm/gist:1146838
Hoedown 2011 Schedule
RUBY HOEDOWN 2011
Day 1 - August 26
-----
8:00 - Registration opens
9:00 - Kickoff with The Improv Effect
10:00 - TorqueBox: A True Application Server for Ruby
@imathis
imathis / rakefile.rb
Created August 24, 2011 21:35
Rakefile
namespace :compass do
desc "Watch Sass files with Compass"
task :watch do
system "compass watch"
end
end
namespace :jekyll do
desc "Watch #{source_dir} directory and recompile on changes"
task :auto do