Skip to content

Instantly share code, notes, and snippets.

@benmanns
benmanns / index.html
Created November 3, 2012 14:06 — forked from mbostock/.block
Spermatozoa
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<style type="text/css">
body {
background: #000;
}
@benmanns
benmanns / chef_solo_bootstrap.sh
Created October 28, 2012 14:29 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p286.tar.gz
tar -xvzf ruby-1.9.3-p286.tar.gz
cd ruby-1.9.3-p286/
./configure --prefix=/usr/local
make
make install
@benmanns
benmanns / rails-stripe-membership-saas.diff
Created October 25, 2012 22:14
This diff shows the differences between a fresh Rails installation and RailsApps/rails-stripe-membership-saas as of ea5bc35c02de4be277682dca964bff8dcb84917c.
diff --git a/.gitignore b/.gitignore
index eb3489a..a6c2a9c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,77 @@
+#----------------------------------------------------------------------------
+# Ignore these files when commiting to a git repository.
+#
# See http://help.github.com/ignore-files/ for more about ignoring files.
#

Go to your public_html directory.

cd ~/public_html

Download WordPress.

wget http://wordpress.org/latest.tar.gz

First things first, you want to make sure that all of your iptables chains are set to ACCEPT, otherwise, you might lock yourself out of the system by blocking the SSH port.

sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT

Next, you can flush your chains to start from scratch.

// Run this in the JavaScript console to remove the SOPA message.
//
// Also, slap yourself for waiting 'til the last minute to finish the report.
//
// I mean, come on.
//
// Seriously.
$('div#mw-sopaOverlay').remove();
$('body').children().show();

CSCI 466 Project 4

Benjamin Manns

Part 1

  • Number of Components: 5
  • Average tail length: 105
  • Maximum tail length: 257
  • Minimum cycle length: 4
@benmanns
benmanns / config-s3.yml
Created December 7, 2011 20:15
rake task to migrate paperclip attachments to Amazon S3
# Required:
access_key_id:
secret_access_key:
bucket_name:
# Optional:
server: s3.amazonaws.com
port: 80
use_ssl: false
persistent: false
@benmanns
benmanns / symmetric.rb
Created October 18, 2011 15:57
Provides symmetric encryption from abc.txt to abc.encrypted and abc.encrypted to abc.txt.
# See http://ruby-doc.org/stdlib-1.9.2/libdoc/digest/rdoc/Digest/Class.html#method-c-digest
# See http://ruby-doc.org/stdlib-1.9.2/libdoc/openssl/rdoc/OpenSSL/Cipher.html
# See http://ruby.about.com/od/rubyfeatures/a/argv.htm
require 'openssl'
# Use this section to encrypt a file
input_file = 'abc.txt'
output_file = 'abc.encrypted'
@benmanns
benmanns / gist:1267915
Created October 6, 2011 16:49 — forked from andrewpthorp/gist:1267848
Preference for helper specs?
# Option 1:
# Use content to separate the helper from the spec
it "should have something" do
content = helper.some_helper_method
content.should have_tag('a', :text => 'foo')
end
# Option 2:
# Combine helper call and spec