Skip to content

Instantly share code, notes, and snippets.

View eclubb's full-sized avatar

Earle Clubb eclubb

  • Valcom, Inc.
  • Roanoke, VA
View GitHub Profile
import requests
from requests.auth import HTTPBasicAuth
import re
from StringIO import StringIO
import urllib
JIRA_URL = 'https://your-jira-url.tld/'
JIRA_ACCOUNT = ('jira-username', 'jira-password')
# the JIRA project ID (short)
JIRA_PROJECT = 'PRO'
@eclubb
eclubb / sqlite2pg.sh
Created March 30, 2012 17:20
Script to import SQLite3 database into PostgreSQL
#!/bin/sh
# This script will migrate schema and data from a SQLite3 database to PostgreSQL.
# Schema translation based on http://stackoverflow.com/a/4581921/1303625.
# Some column types are not handled (e.g blobs).
SQLITE_DB_PATH=$1
PG_DB_NAME=$2
PG_USER_NAME=$3
rails generate migration add_image_id_to_blog_posts image_id:integer
rake db:migrate
Override the blog category model and add:
belongs_to :image
Override the blog category form and add an image picker to it:
<div class='field'>
<%= f.label :image -%>
<%= render :partial => "/shared/admin/image_picker", :locals => {
earle@king ~/projects/websites $ refinerycms/bin/refinerycms dummy
Running: /home/earle/.rvm/rubies/ree-1.8.7-2011.03/bin/ruby -S rails new "/home/earle/projects/websites/dummy" --database sqlite3 --skip-test-unit --skip-prototype
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/controllers/application_controller.rb
@eclubb
eclubb / category.rb
Created April 8, 2011 21:42
HABTM with deferred save error
class Category < ActiveRecord::Base
has_and_belongs_to_many_with_deferred_save :posts
end
A NoMethodError occurred in pages#update:
undefined method `cache_path' for #<ActiveSupport::Cache::MemoryStore:0x9afc1bc>
/home/orchard_hills_church-staging/apps/orchard_hills_church/shared/bundle/ruby/1.8/bundler/gems/refinerycms-7bd49ac79ab4/pages/app/models/page.rb:241:in `expire_page_caching'
-------------------------------
Backtrace:
-------------------------------
-# Note that in this scenario, there is only one comment.
= simple_form_for @post do |post_form|
...
= post_form.simple_fields_for :comments do |comment_form|
comment_form.input :name
comment_form.input :email
module DataMapper
module Reflection
def self.included(model)
model.extend ClassMethods
end
module ClassMethods
def reflect_on_association(association)
relationship = relationships[association]
MacroReflection.new(relationship, relationship.name, {})
A ArgumentError occurred in users#forgot:
A sender (Return-Path, Sender or From) required to send a message
mail (2.2.12) lib/mail/network/delivery_methods/smtp.rb:97:in `deliver!'
mail (2.2.12) lib/mail/message.rb:1964:in `do_delivery'
mail (2.2.12) lib/mail/message.rb:228:in `deliver'
actionmailer (3.0.3) lib/action_mailer/base.rb:401:in `deliver_mail'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
$ sudo gem uninstall do_sqlite3
Successfully uninstalled do_sqlite3-0.9.10.1
$ sudo gem install -l pkg/do_sqlite3-0.9.10.1-x86-linux.gem --no-rdoc --no-ri
Successfully installed do_sqlite3-0.9.10.1-x86-linux
1 gem installed
$ sudo gem uninstall do_sqlite3
Successfully uninstalled do_sqlite3-0.9.10.1-x86-linux