Skip to content

Instantly share code, notes, and snippets.

@cmaujean
cmaujean / 01_add_custom_admin_roles.rb
Created October 11, 2011 04:52
Customizing Spree Roles - 0.60-stable - a basic example of adding custom roles to spree
# db/migrate/01_add_custom_admin_roles.rb
class AddCustomAdminRoles < ActiveRecord::Migration
@roles = %w[extra]
def self.up
@roles.each do |r|
Role.create(:name => r)
end
end
@clintongormley
clintongormley / gist:1037563
Created June 21, 2011 10:06
Edge ngram example for elasticsearch
# [Tue Jun 21 12:05:39 2011] Protocol: http, Server: 192.168.5.103:9200
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1' -d '
{
"mappings" : {
"contact" : {
"properties" : {
"twitter" : {
"type" : "object",
"properties" : {
"profile" : {