Skip to content

Instantly share code, notes, and snippets.

@psndcsrv
psndcsrv / console_script.rb
Last active August 29, 2015 14:21
Portal Teacher info
require 'csv'
csv = CSV.open("teachers4.csv","w")
ts = Portal::Teacher.includes(:user).all
data = ts.map do |t|
students = 0
[
t.first_name,
t.last_name,
Notice: register_uninstall_hook was called <strong>incorrectly</strong>. Only a static class method or function can be used in an uninstall hook. (This message was added in version 3.1.) in /web/static/journal/wp-includes/functions.php on line 3422
Notice: Constant MORE_PLUGINS_SPUTNIK_7 already defined in /web/static/journal/wp-content/plugins/more-types/more-plugins/more-plugins.php on line 203
Notice: Undefined property: stdClass::$siteurl in /web/static/journal/wp-content/plugins/safe-report-comments/safe-report-comments.php on line 91
Notice: Use of undefined constant SITECOOKIEPATH - assumed 'SITECOOKIEPATH' in /web/static/journal/wp-content/plugins/safe-report-comments/safe-report-comments.php on line 98
@psndcsrv
psndcsrv / gets.txt
Created December 9, 2013 20:34
ITSI portal routes
help_requests GET /help_requests(.:format) {:action=>"index", :controller=>"help_requests"}
new_help_request GET /help_requests/new(.:format) {:action=>"new", :controller=>"help_requests"}
edit_help_request GET /help_requests/:id/edit(.:format) {:action=>"edit", :controller=>"help_requests"}
help_request GET /help_requests/:id(.:format) {:action=>"show", :controller=>"help_requests"}
saveable_sparks_measuring_resistances GET /saveable/sparks/measuring_resistances(.:format) {:action=>"index", :control
@psndcsrv
psndcsrv / gist:6874123
Last active December 24, 2015 22:39
Proposed AgentScript state model
{
"agentProperties": {
"rain": ["breed","y","x","heading"],
"evap": ["breed","y","x","heading"]
},
"agents": [
["rain",86,-15,3.141592653589793],
["rain",86,-247,0],
["rain",86,-260,0],
["rain",87,201,3.141592653589793],
@psndcsrv
psndcsrv / publish.feature
Last active December 16, 2015 19:00
cucumber tests for publishing api
Feature: External Activities can support a REST publishing api
Background:
Given an external activity named "Fun Stuff" with the definition
"""
{
"name": "Cool Activity",
"url": "http://activity.com/activity/1",
"create_url": "http://activity.com/activity/1/sessions/",
"description": "This activity does fun stuff.",
"sections": [
Running Mocha tests ...
✖ 1 of 310 tests failed:
1) "before all" hook:
TypeError: undefined is not a function
at /home/aunger/git/lab/test/mocha/md2d/units-translation-spec.coffee:108:21
at Object.context.execCb (/home/aunger/git/lab/node_modules/requirejs/bin/r.js:1849:33)
@psndcsrv
psndcsrv / start_passenger.rb
Created May 25, 2011 18:34
daemon_controller starting passenger
require 'rubygems'
require 'daemon_controller'
require 'socket'
ROOT = File.expand_path(File.dirname(__FILE__))
d = DaemonController.new(
:identifier => "Rails Backend",
:start_command => "passenger start -d -e test -p 3000",
:ping_command => lambda { TCPSocket.new('localhost', 3000)},
<viewEntries>
<OTChoiceViewConfig objectClass="org.concord.otrunk.ui.OTChoice"
viewClass="org.concord.otrunk.ui.swing.OTChoiceView"
useViewsAsChoices="true">
<radioButtonViewEntry>
<OTViewEntry objectClass="org.concord.otrunk.ui.OTChoice" viewClass="org.concord.otrunk.ui.swing.OTChoiceRadioButtonView" />
</radioButtonViewEntry>
<menuViewEntry>
<OTViewEntry objectClass="org.concord.otrunk.ui.OTChoice" viewClass="org.concord.otrunk.ui.swing.OTChoiceMenuView" />
</menuViewEntry>
@psndcsrv
psndcsrv / model_string_generator.rb
Created June 24, 2009 14:02
a jruby script for generating useful strings to be included when creating new rigse models and views
require 'rubygems'
require 'java'
require 'jnlp'
require 'open-uri'
require 'hpricot'
require 'activesupport'
@@java_type_to_activerecord_type = {
"java.lang.String" => "string",
"java.lang.Boolean" => "boolean",