Skip to content

Instantly share code, notes, and snippets.

View scottmessinger's full-sized avatar

Scott Ames-Messinger scottmessinger

View GitHub Profile
$('.editable').mouseenter(function(){
$(this).children('.nubbin_wrapper').fadeIn()
})
$('.editable').mouseleave(function(){
$(this).children('.nubbin_wrapper').fadeOut()
})
teachfirst:mongocc ScottMessinger$ rvm info
ruby-1.8.7-p299@mongocc:
system:
uname: "Darwin teachfirst.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386"
shell: "bash"
version: "3.2.48(1)-release"
rvm:
version: "rvm 0.1.41 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]"
def sort_roots
sequence_groups = []
#turn hash into array
params[:sequence_groups].each do |k, v|
sequence_groups << v
end
# First, assign the correct group_id
root_sequences = []
sequence_groups.each do |sg|
group_id = sg.keys[0].to_s.gsub('sequence_group_', '')
@scottmessinger
scottmessinger / Sort_roots.rb
Created August 18, 2010 19:51
From Courses controller
def sort_roots
sequence_groups = []
#turn hash into array
params[:sequence_groups].each do |k, v|
sequence_groups << v
end
# First, assign the correct group_id
root_sequences = []
sequence_groups.each do |sg|
group_id = sg.keys[0].to_s.gsub('sequence_group_', '')
$('.editable').live('mouseover mouseout', function(event) {
if (event.type == 'mouseover') {
function() {
$(this).children('.nubbin_wrapper').show();
}
} else {
function() {
$(this).children('.nubbin_wrapper').hide();
}
}
@scottmessinger
scottmessinger / Sorting Sequences.rb
Created August 20, 2010 13:58
Sorting sequences
# from sequences_controller.rb
def sort
sequence_groups = []
#turn hash into array
if params[:sequence_groups]
params[:sequence_groups].each do |k, v|
sequence_groups << v
end
array = Sequence.assign_group_id(sequence_groups)
@scottmessinger
scottmessinger / match_window.rb
Created October 20, 2010 00:51
Shows the filename in the finder window
def match_text_for_idx idx
match = truncated_match @matches[idx]
if idx == @selection
prefix = @@selection_marker
suffix = padding_for_selected_match match
else
prefix = @@unselected_marker
suffix = ''
end
prefix + file_name(match) + match + suffix
module CoursePresenters
class ShowPresenter < Presenter
include AvailableResourceTypes
available_types #this is how I initialize availabe_resource_types...there has to be a better way
include CanCan::Ability
def initialize(course, current_user)
@current_user = current_user || User.new
@course = Course.find(course)
@scottmessinger
scottmessinger / standards.json
Created January 19, 2011 18:29
Scott's thoughts on an ideal schema
{
"uuid": "1a8c3540-ad56-53a4-92b4-cbb1e90f2e6f",
"ukey": "CC.E.K.RF.Print Concepts.1.a",
"_id": "1a8c3540-ad56-53a4-92b4-cbb1e90f2e6f",
"set": "Common Core State Standards Initiative",
"set_code": "CC",
"subject": "English/Language Arts",
"subject code": "E",
<iframe name='please' style='display: none' src='https://spreadsheets.google.com/formResponse?formkey=asdasdf'></iframe>
<form target='please' action='https://spreadsheets.google.com/formResponse?formkey=asdasdf' class='contact_us' id='contact_us_form' method='POST' >