Skip to content

Instantly share code, notes, and snippets.

Jonathan Rochkind jrochkind

Block or report user

Report or block jrochkind

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:344083
$(".more_facets_link a").each(function() {
//We use each to let us make a Dialog object for each
//a, tied to that a, through the miracle of closures. the second
// arg to 'bind' is used to make sure the event handler gets it's
// own dialog.
var more_facets_dialog = $("<div></div>").dialog({ autoOpen: false });
$(this).bind("click", {dialog: more_facets_dialog}, function( event ) {
// Load the original URL on the link into the dialog associated
// with it.
// Rails app will give us an appropriate partial.
View gist:344110
$(".more_facets_link a").each(function() {
//We use each to let us make a Dialog object for each
//a, tied to that a, through the miracle of closures. the second
// arg to 'bind' is used to make sure the event handler gets it's
// own dialog.
var more_facets_dialog = "empty";
$(this).click( function() {
//lazy create of dialog
if ( more_facets_dialog == "empty") {
View gist:349695
irb(main):011:0> class AutoHash
irb(main):012:1> def initialize(*args)
irb(main):013:2> super(*args) {|hash, key| hash[key] = AutoHash.new }
irb(main):014:2> end
irb(main):015:1> end
=> nil
irb(main):016:0> a = AutoHash.new
=> {}
irb(main):017:0> a["foo"]["bar"]["baz"]
=> {}
View gist:527185
import org.marc4j.marc.Record;
import org.marc4j.marc.DataField;
import org.marc4j.marc.Subfield;
import org.solrmarc.tools.Utils;
// define the base level indexer so that its methods can be called from the script.
// note that the SolrIndexer code will set this value before the script methods are called.
org.solrmarc.index.SolrIndexer indexer = null;
// Max estimation -- biggest delta of unknown dates that we'll take the
View gist:559939
====
= config.properties
====
# solrmarc.solr.war.path - must point to either a war file for the version of Solr that
# you want to use, or to a directory of jar files extracted from a Solr war files. If
# this is not provided, SolrMarc can only work by communicating with a running Solr server.
# Uncomment war.path and solr.path only if you want solrmarc to manually
# write lucene indexes to disk. We do not! We want to use conventional
View gist:591974
module MarcDisplay
# in order to get our nice shortcut method, we mix in MarcLogicProcs
# as class methods, so we can use them in our class var definition.
self.extend(MarcDisplayLogic::MarcLogicProcs)
def self.default_presenter_config_list
DefaultPresenterConfigList
end
View gist:593897
import org.marc4j.marc.Record;
import org.marc4j.marc.DataField;
import org.marc4j.marc.Subfield;
import org.solrmarc.tools.Utils;
// define the base level indexer so that its methods can be called from the script.
// note that the SolrIndexer code will set this value before the script methods are called.
org.solrmarc.index.SolrIndexer indexer = null;
/** Transformational hashes **/
View add custom CSS to Blacklight app.rb
# put this in any .rb file in config/initializers , make up your own, put it in an
# existing one, whatever works for you.
# As with many things in rails/Blacklight, there are many ways to do this, but
# this is one, it looks kinda complicated becuase it's trying to deal with
# cache_classes=false business.
module LocalAssetInclude
def add_local_assets
# my_local_stylesheet.css should be found in your app's public/stylesheets/
@jrochkind
jrochkind / document_namespace_guessing.rb
Created Oct 26, 2010
XML::Document#xpath inconsistent use of assumed namespaces
View document_namespace_guessing.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
xml = %Q{
<root xmlns:example="http://example.org">
<example:element>
<example:child>
@jrochkind
jrochkind / jQuery.collapsible.js
Created Nov 3, 2010
modified collapsible.js
View jQuery.collapsible.js
/**
* --------------------------------------------------------------------
* jQuery collapsible plugin
* Author: Scott Jehl, scott@filamentgroup.com
* Copyright (c) 2009 Filament Group
* licensed under MIT (filamentgroup.com/examples/mit-license.txt)
* --------------------------------------------------------------------
*
* See: http://dwpe.googlecode.com
* http://filamentgroup.com/lab/expand_and_collapse_content_accessibly_with_progressive_enhancement_jquery/
You can’t perform that action at this time.