Skip to content

Instantly share code, notes, and snippets.

View cgat's full-sized avatar

Chris Gat cgat

  • Metalab Design
  • The World
View GitHub Profile
@cgat
cgat / gist:988fbca1b228a1b44ad4
Last active November 2, 2015 13:48
Chloropleth Charts with leaflet in DC.js
//Sample usage
/* Inspired by this example http://bost.ocks.org/mike/leaflet/
map = new L.Map(...); //height and width should be set on your map, not the chart
dcMap = dc.leafletChloroplethChart('#my_map');
//Again, instead of specifying width and height, you specify the map instance.
dcMap.dimension(regionDim)
.group(regionDim.group().reduceSum(function (d) {
return d.duration;
}))
.map(map)
@cgat
cgat / gist:5873205
Created June 27, 2013 01:09
my rails app schema
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
@cgat
cgat / gist:5132156
Created March 11, 2013 06:05
output for the following commands: HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew upgrade --use-llvm vips cat ~/Library/Logs/Homebrew/vips/config.log (there was no 03.make file) brew doctor
HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew upgrade --use-llvm vips
==> Upgrading vips
rm /usr/local/bin/vipsthumbnail
rm /usr/local/bin/vips-7.30
rm /usr/local/bin/vips
rm /usr/local/bin/shrink_width
rm /usr/local/bin/mergeup
rm /usr/local/bin/light_correct
rm /usr/local/bin/header
rm /usr/local/bin/find_mosaic
Support::Backends::ClassMethods.enqueue_for_backend(worker#Class, class_name#String,...)
at line /Users/chrisgat/.rvm/gems/ruby-1.9.3-p194/gems/carrierwave_backgrounder-0.2.0/lib/backgrounder/support/backends.rb:19
#1 #<Module:0x00000102fab7e0>.enqueue_image_background_job
at line /Users/chrisgat/.rvm/gems/ruby-1.9.3-p194/gems/carrierwave_backgrounder-0.2.0/lib/backgrounder/orm/base.rb:107
#2 CaptureImage._run__2609034636892101181__commit__2962896698304487768__callbacks
at line /Users/chrisgat/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:409
#3 ActiveSupport::Callbacks::ClassMethods.__run_callback(key#NilClass, kind#Symbol,...)
at line /Users/chrisgat/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:405
#4 ActiveRecord::Base._run_commit_callbacks
at line /Users/chrisgat/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.12/lib/active_support/callbacks.rb:385
class CaptureImage < ActiveRecord::Base
include NumberHelper
include ImageHelper
is_filesystemable
attr_accessible :captureable_id, :captureable_type, :bit_depth, :image, :image_remote, :file_size, :hash_key, :image_state, :x_dim, :y_dim, :remote, :image_secure_token, :comments, :legacy_path
attr_accessible :image_cache
require 'uuidtools'
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::Vips
#include CarrierWave::RMagick
include ::CarrierWave::Backgrounder::Delay
#include ModuleHelper::Helper
# Include the Sprockets helpers for Rails 3.1+ asset pipeline compatibility:
include Sprockets::Helpers::RailsHelper
include Sprockets::Helpers::IsolatedHelper