Skip to content

Instantly share code, notes, and snippets.

View joshnabbott's full-sized avatar

Josh N. Abbott joshnabbott

  • Cloudflare Past:Area 1 Security, Big Cartel, Kajabi, Factory Design Labs, Oakley
  • Albuquerque, NM
View GitHub Profile
@joshnabbott
joshnabbott / gist:4035682
Created November 8, 2012 00:49 — forked from shripadk/gist:552554
Setting up Heroku Hostname SSL with GoDaddy SSL Cert
II. Creating a Certificate Signing Request (CSR)
Note: To create an SSL certificate, you must first generate and submit a Certificate Signing Request (CSR) to the Certification Authority (CA) (i.e. GoDaddy). The CSR contains your certificate-application information, including your public key. The CSR will also create your public/private key pair used for encrypting and decrypting secure transactions.
These instructions are based on my experience using a Mac OS X laptop. The following probably won't work if you are not working from a unix-based system (i.e. Mac OS X / Ubuntu Linux / etc.).
Steps to create a CSR:
1. Make a new directory to hold your project's SSL-related stuff. It doesn't really matter where you put this, but I recommend not putting it in your rails project (i.e. alongside app, config, db, etc.), as it will get included in your git repository if you do. Rather, I put it in a folder that is one level above my rails project.
(($) ->
class CheckboxSource
constructor: (@root) ->
data: -> _.map @root.find(":checkbox:checked"), (obj) -> $(obj).val()
$ ->
$("*[data-checkbox-source]").each ->
self = $(this)
source = new CheckboxSource(self)
key = self.data("checkbox-source")
# Some benchmarking I did on a local redis instance
# Tested using:
# Mac OSX Lion
# Ruby 1.9.3
# IRB
# Redis 2.4.8
# 10_000
>> r.info['used_memory_human']
@joshnabbott
joshnabbott / gist:2649072
Created May 9, 2012 21:35 — forked from mikeyk/gist:1329319
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
<div class="controls span6"><%= f.select :dashboard_post_id, all_posts_options, {}, :class => "span4" %></div>
-webkit-box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
map <C-h> <C-w>h
# Add all gems in the global gemset to the $LOAD_PATH so they can be used even
# in places like 'rails console'.
if defined?(::Bundler)
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first
if global_gemset
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*")
all_global_gem_paths.each do |p|
gem_path = "#{p}/lib"
$LOAD_PATH << gem_path
end
To uninstall Pow, `curl get.pow.cx/uninstall.sh | sh`
@joshnabbott
joshnabbott / gist:1936170
Created February 28, 2012 23:33 — forked from stephenmckinney/gist:1932021
Installing Ruby 1.8.7 on Lion with only Command Line Tools for Xcode non-llvm gcc 4.2

Installing older Rubies (e.g. Ruby 1.8.7) on a clean install of Lion and Xcode

The latest Xcode and Command Line Tools for Xcode changes the default compiler from gcc to the llvm compiler. Only ruby-1.9.3-p125+ is LLVM ready. So, you will have to install gcc-4.2 to compile older versions of Ruby. More detail here https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers.

This worked for me. I hope it saves some people time:

brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/apple-gcc42.rb
CC=/usr/local/bin/gcc-4.2 rvm install 1.8.7