Skip to content

Instantly share code, notes, and snippets.

View sud0n1m's full-sized avatar

Colin Nederkoorn sud0n1m

View GitHub Profile
/* 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
@sud0n1m
sud0n1m / gist:4190198
Created December 2, 2012 18:02
Amazon S3 Policy
{
"Version": "2008-10-17",
"Id": "b2cc31d0-cc91-4285-a658-473099d2c867",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
source: .
destination: ../public
includes: ./_includes
plugins: ./_plugins
pygments: true
permalink: /blog/:title.html
base_url: http://customer.io
description: Customer.io
root_desc: Customer.io