Skip to content

Instantly share code, notes, and snippets.

View danhorst's full-sized avatar
🛳️
SHIP IT

Dan Brubaker Horst danhorst

🛳️
SHIP IT
View GitHub Profile
<div class="control-group required link-users" id="editors">
<span class="control-label">
<label class="required" for="<%=f.object.class.to_s.downcase%>_editors_attributes_0_name">
<%# NOTE: Whenever you just copy the HTML generated by Simple Form it breaks internationalization %>
<%= I18n.t('simple_form.required.html', default: '<abbr title="" data-original-title="required">*</abbr>').html_safe %>
<%= I18n.t('sufia.work.editor.individual.name' %>
<span class="help-inline"><%= I18n.t('sufia.work.editor.individual.help' %></span>
</label>
</span>
<%# Rest of the file ... %>
@danhorst
danhorst / Gemfile
Last active December 28, 2015 08:39
The Curate gem's internal test application doesn't generate quite right. I make these change two files manually after the test application is generated: `spec/internal/Gemfile`, `spec/internal/app/assets/javascripts/application.js` And re-run bundle install.
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
@danhorst
danhorst / Boxen project for clamav
Last active December 18, 2015 00:59
How to install the clamav gem on Mac OS X with boxen & homebrew installed clamav. Inspired by: https://gist.github.com/anarchivist/1724852
# /opt/boxen/repo/modules/projects/manifests/your_project.pp
# Install with: boxen your_project
#
# When you're using boxen DO NOT install clamav directly with: brew install clamav
# It won't link the header files correctly.
include homebrew
class projects::your_project {
notify { 'Setting up Your Project': }
@danhorst
danhorst / A Summary
Created April 4, 2013 19:04
Sufia load error
TEMPORARY SOLUTION
`rm spec/factories/senior_thesis_factory.rb`
`bundle exec rake db:drop db:create db:migrate`
`git co -- spec/factories/senior_thesis_factory.rb`
PROBLEM
When the factory for senior thesis loads without the database table 'local_authorities' present it fails:
spec/factories/senior_thesis_factory.rb
@danhorst
danhorst / microfilm.rb
Created June 20, 2012 12:49
Example Rails model that is indexed into Solr with Blacklight
class Microfilm < ActiveRecord::Base
belongs_to :library
belongs_to :location
belongs_to :collection
after_save :update_solr unless ENV['DO_NOT_INDEX']
after_destroy :remove_from_solr
scope :with_shelf_mark, lambda { |*shelf_mark|
where("#{quoted_table_name}.`shelf_mark` LIKE ?", "%#{shelf_mark.flatten.first}%") unless shelf_mark.flatten.first.blank?
@danhorst
danhorst / gist:1207464
Created September 9, 2011 22:10
Looksee Gemspec for version 1.0.3
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{looksee}
s.version = "1.0.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["George Ogata"]
s.date = %q{2011-09-05 00:00:00.000000000Z}
s.email = ["[email protected]"]
@danhorst
danhorst / form-baseline.css
Created April 15, 2011 13:31
Custom CSS for Google docs form
/**
* Userstyle can be applied using the Stylish Firefox extension
* https://addons.mozilla.org/en-US/firefox/addon/stylish/
**/
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("spreadsheets.google.com") {
/** Page structure styles **/
.ss-form-container, .ss-container {border:3px solid #666 !important; margin:50px 0 0 400px !important; -moz-border-radius: 5px; padding:1.5em 1.5em 0 !important; width:580px !important;}
.ss-resp-card{border:none !important;}
@danhorst
danhorst / blackligth installtion
Created February 22, 2010 17:56
blacklight installation
When I first tried to install blacklight not everything went smoothly.
These instructions are based on the documentation provided here:
http://github.com/projectblacklight/blacklight/blob/master/doc/README_INSTALLATION.rdoc
Install the dependencies:
-------------------------
$ sudo gem install rails
$ sudo gem install test-unit --version=1.2.3
$ sudo gem install authlogic --version=2.1.2
$ sudo gem install marc --version=0.3.0