Skip to content

Instantly share code, notes, and snippets.

@knowuh
knowuh / answers
Last active August 29, 2015 14:08
Answer which is choking process_external_activity_data_job.rb
[
{
"type":"open_response",
"question_id":"4462",
"answer":"The increase demands during day because it might be something you need it for and the same thing through the season.",
"is_final":false
},
{
"type":"open_response",
"question_id":"4463",
@knowuh
knowuh / replace_run_in_sequence.rb
Created December 10, 2014 20:25
Given a sequence run, and an anonymous activity_run, insert the anonymous run into the sequence_run.
def replace_run_in_sequence(seq_r_id, new_run_id)
new_run = Run.find(new_run_id)
sequence_run = SequenceRun.find(seq_r_id)
old_run = sequence_run.runs.detect { |r| r.activity_id == new_run.activity_id }
if old_run
clone_run(old_run,new_run)
if new_run.percent_complete > old_run.percent_complete
puts "removing run #{old_run.id}"
sequence_run.runs.delete(old_run)
@knowuh
knowuh / se
Last active August 29, 2015 14:16
Open the current directory with subl (sublime text) -- optionally using a project file.
#!/bin/bash
# Chmod this u+x and put it in your $PATH
# Open the first .sublime-project or the working dir
# in SublimeText assumes that `subl` is in your path
for f in ./*.sublime-project; do
if [ -e "$f" ]
then
subl --project "$f"
<VirtualHost 127.0.0.1>
RailsDefaultUser npaessel
RailsEnv production
ServerName rigse.noah
DocumentRoot "/Users/npaessel/lab/ruby/rigse/public"
ErrorLog "/Users/npaessel/lab/ruby/rigse/log/error.log"
<Directory "/Users/npaessel/lab/ruby/rigse/public">
Options FollowSymLinks MultiViews Includes
AllowOverride All
LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
PassengerRoot /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6
PassengerRuby /opt/local/bin/ruby
<?xml version='1.0' encoding='utf-8' ?>
<otrunk id='8b6cbdfe-2b81-11de-a70e-001ff3caa767'>
<imports>
<import class='org.concord.otrunk.OTSystem' />
<import class='org.concord.framework.otrunk.view.OTFrame' />
<import class='org.concord.otrunk.view.OTViewEntry' />
<import class='org.concord.otrunk.view.OTViewBundle' />
<import class='org.concord.otrunk.view.document.OTDocumentViewConfig' />
<import class='org.concord.otrunk.view.document.OTCompoundDoc' />
<import class='org.concord.otrunk.ui.OTText' />
git config --global github.user
<OTChoice alignContent='0' name='Multiple choice'>
<choices>
<OTCompoundDoc name='1. Purple'>
<bodyText>Green (body text)</bodyText>
</OTCompoundDoc>
<OTCompoundDoc name='2. Purple'>
<bodyText>Purple (body text)</bodyText>
</OTCompoundDoc>
#
# SDS configuration file
#
development:
host: http://sds.local/sds/1
jnlp_id: 1
curnit_id: 1
username:
password:
default_offering_id: 1
84K ./public/javascripts//tiny_mce/plugins/inlinepopups
88K ./public/javascripts//tiny_mce/plugins/emotions
104K ./public/javascripts//tiny_mce/plugins/xhtmlxtras
108K ./public/javascripts//tiny_mce/themes/advanced/skins
124K ./public/javascripts//tiny_mce/plugins/media
136K ./public/javascripts//tiny_mce/plugins/table
168K ./public/javascripts//flotr
180K ./public/javascripts//prototype-ui
280K ./public/javascripts//tiny_mce/themes/advanced
320K ./public/javascripts//tiny_mce/themes