Skip to content

Instantly share code, notes, and snippets.

View sud0n1m's full-sized avatar

Colin Nederkoorn sud0n1m

View GitHub Profile
@sud0n1m
sud0n1m / gist:1876736
Created February 21, 2012 14:10
Error installing jekyll
gem install jekyll
Fetching: liquid-2.3.0.gem (100%)
Fetching: fast-stemmer-1.0.0.gem (100%)
Building native extensions. This could take a while...
Fetching: classifier-1.3.3.gem (100%)
Fetching: directory_watcher-1.4.1.gem (100%)
Fetching: syntax-1.0.0.gem (100%)
Fetching: maruku-0.6.0.gem (100%)
Fetching: kramdown-0.13.5.gem (155B)
ERROR: Error installing jekyll:
@sud0n1m
sud0n1m / gist:1917447
Created February 26, 2012 15:54
Docco install commands for Lion assuming homebrew and nothing else.
brew install python
### Add python to the path so OSX doesn't use system python
export PATH="/usr/local/share/python:${PATH}"
### Install pip to install pygments
easy_install pip
pip install --upgrade distribute
### Install pygments for syntax highlighting
pip install pygments
/* This should work well. We'll use the "plan" variable. When a user signs up it will be blank.
* When they complete the process, it should be "Premium" or whatever you would call your plan.
* Using the created at date, we'll send users an email X days after signup if the plan is blank.
*/
<script type="text/javascript">
var _cio = _cio || [];
@sud0n1m
sud0n1m / README.mkd
Created May 28, 2012 21:39
Grouped bar

This is a reimplementation of the Grouped Bar Chart by Mike Bostock. Although useful, I found the original's minimal comments and inverted axes hard to follow, so I created the version you see here.

@sud0n1m
sud0n1m / doesntwork.js
Created June 4, 2012 14:40
Functional code...
function Penguin(name) {
this.name = name;
this.numLegs = 2;
}
// create your Emperor class here and make it inherit from Penguin
function Emperor(name){
this.prototype = new Penguin(name);
@sud0n1m
sud0n1m / gist:3082897
Created July 10, 2012 11:59
Cmake errors on Mountain Lion GM
Last login: Tue Jul 10 07:54:59 on tty??
➜ ~ brew install -v cmake
Warning: Not sure what version of Xcode is the latest for OS X 10.8.
==> Downloading http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz
Already downloaded: /Library/Caches/Homebrew/cmake-2.8.8.tar.gz
/usr/bin/tar xf /Library/Caches/Homebrew/cmake-2.8.8.tar.gz
==> Downloading patches
/usr/bin/curl -qf#LA Homebrew 0.9.2 (Ruby 1.8.7-358; Mac OS X 10.8) https://github.com/Kitware/CMake/commit/3ea850.patch -o 000-homebrew.diff https://github.com/Kitware/CMake/commit/8b2fb3.patch -o 001-homebrew.diff
######################################################################## 100.0%
######################################################################## 100.0%
@sud0n1m
sud0n1m / caddy.sh
Created September 11, 2012 00:43
Caddy -> Pump data into Customer.io from CSV
#!/bin/bash
echo "Caddy v 0.1 from Customer.io"
ENDPOINT="https://app.customer.io/api/v1/customers/"
SITEID="YOUR SITE ID"
APIKEY="YOUR API KEY"
INPUT=users.csv
OLDIFS=$IFS
@sud0n1m
sud0n1m / gist:3761675
Created September 21, 2012 14:11
Fix a div when scrolling
<script type="text/javascript">
$(window).scroll(function() { if ($(window).scrollTop() > 110) $("#signupbox").css("position", "fixed"); else $("#signupbox").css("position", "static"); });
</script>
var email = $("#email").val();
var id = email.replace('@', '_');
id = id.replace('.', '_');
@sud0n1m
sud0n1m / premailer_monkey_path.rb
Created October 28, 2012 22:27
An initializer we added so premailer supports @media queries.
# Patched to no process @media queries in <style> blocks.
# For HTML emails, @media queries are exclusively used for
# targeting mobile clients. These should not be inlined.
class CssParser::Parser
def parse_block_into_rule_sets!(block, options = {}) # :nodoc:
current_media_queries = [:all]
if options[:media_types]
current_media_queries = options[:media_types].flatten.collect { |mt| CssParser.sanitize_media_query(mt)}
end