Skip to content

Instantly share code, notes, and snippets.

View mstump's full-sized avatar
😀

Matt Stump mstump

😀
  • San Francisco, CA
View GitHub Profile
@rmoriz
rmoriz / Gemfile
Last active September 23, 2024 03:00
UUID primary keys in Rails 3
# Gemfile
gem 'uuidtools'
@ArtemGr
ArtemGr / crc64.cc
Created May 29, 2011 15:58
crc64 with Boost
// aptitude install libboost-dev
// http://www.boost.org/doc/libs/1_52_0/libs/crc/crc.html
#include <boost/crc.hpp>
static uint64_t crc64 (const string& str) {
boost::crc_optimal<64, 0x04C11DB7, 0, 0, false, false> crc;
crc.process_bytes (str.data(), str.size());
return crc.checksum();
};
(ns cascalog.helpers
(:use cascalog.api)
(:import [org.apache.hadoop.mapred JobConf]
[cascalog Util]))
(defn lazy-generator
"Returns a cascalog generator on the supplied lazy
sequence. `lazy-generator` serializes each item in the lazy sequence
into a sequencefile located at the supplied temporary directory, and
returns a tap into its guts.
@hugoduncan
hugoduncan / gist:1033762
Created June 19, 2011 04:36
Use aether for artifact resolving
(ns pallet.aether
"Wrapper for aether resolution
See:
https://docs.sonatype.org/display/AETHER/Home"
(:require
[clojure.java.io :as io]
[clojure.contrib.logging :as logging])
(import
org.apache.maven.repository.internal.MavenRepositorySystemSession
@bartiaco
bartiaco / default.rb
Created July 20, 2011 18:29
Chef recipe for using private gem repositories in github, from engineyard appcloud
#
# Cookbook Name:: github_key
# Recipe:: default
#
ey_cloud_report "github_key" do
message "Running Custom Github SSH Key Chef Configuration"
end
# loop over all application instances
@guilleiguaran
guilleiguaran / expiring.rb
Created August 4, 2011 17:02
Expiring values with Ohm
module Ohm
module Expiring
def self.included(base)
base.send(:extend, ClassMethods)
end
module ClassMethods
def expire(ttl)
@@expire = ttl.to_i
end
@rwilcox
rwilcox / asset_path.rb
Created August 17, 2011 14:39
AssetPath.sass_require: for sharing SASS variables between SASS files in the Rails 3.1 Asset Pipeline
module AssetPath
# Why this instead of Sproket's require_tree?
# Sprokets compiles one SASS file at a time, which works OK... until you want
# to pull out some SASS things (mixins, layout settings) into separate files.
# In that case, you want to have SASS compile everything all at once, in one big file
# So, use this helper to include all the SASS files down a path
#
# The alternative is the ugly (and not DRY!): <http://asciicasts.com/episodes/268-sass-basics>
# where you list every file manually in the application.css.scass file.
@kashif
kashif / ubuntu-11.10-gems.erb
Created October 10, 2011 11:58 — forked from bensie/chef_bootstrap_rvm.erb
Chef bootstrap With rvm and ruby 1.9.3 on ubuntu 11.10
bash -c '
<% if knife_config[:bootstrap_proxy] -%>
(
cat <<'EOP'
<%= "proxy = #{knife_config[:bootstrap_proxy]}" %>
EOP
) > ~/.curlrc
<% end -%>
if [ ! -f /usr/bin/chef-client ]; then
@ilyabo
ilyabo / index.html
Created November 17, 2011 14:29
D3 tooltip using jQuery tipsy
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="jquery.tipsy.js"></script>
<link href="tipsy.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="chart"></div>
@matthewhudson
matthewhudson / Ubuntu s3fs install
Created December 13, 2011 01:50
Ubuntu s3fs install & dependencies.
# Install prerequisites before compiling:
apt-get install build-essential
apt-get install libfuse-dev
apt-get install fuse-utils
apt-get install libcurl4-openssl-dev
apt-get install libxml2-dev
apt-get install mime-support
# Download and Install
wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz