Skip to content

Instantly share code, notes, and snippets.

View rklancer's full-sized avatar

Richard Klancer rklancer

View GitHub Profile
@rklancer
rklancer / arg-block.rb
Last active August 29, 2015 14:18
Queries for Arg Block report
# Start with a list of endpoints; here we just use all of them
endpoints = Run.where("remote_endpoint IS NOT NULL").map &:remote_endpoint
select_params = [
{
:embeddable_type => "Embeddable::OpenResponse",
:embeddable_table => "embeddable_open_responses",
:answer_table => "embeddable_open_response_answers",
:question_foreign_key => "open_response_id",
:feedback_table => "c_rater_feedback_items",
asciify <- function(text) {
text <- stri_trans_general(text, 'Any-Latin')
text <- stri_trans_general(text, 'Any-Publishing')
text <- stri_trans_general(text, 'Latin-Ascii')
text
}
getContext <- function(re, data=sampleData) {
reWithContext <- paste0(".{0,10}", re, ".{0,10}")
context <- data[grep(reWithContext, data$text, perl=T),]
m <- regexpr(reWithContext, context$text, perl=T)
cbind(context, data.frame(context=regmatches(context$text, m)))
}
writeOut <- function(df, fname) {
f <- file(fname, 'wt')
for (rownum in 1:nrow(df)) {
{
"name": "Untitled Document",
"guid": 11,
"components": [
{
"type": "DG.GameView",
"guid": 101,
"componentStorage": {
"currentGameName": "CartWeight",
"currentGameUrl": "http://localhost:8000/CartWeight/",
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Simple Molecules</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geo.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
<style type="text/css">
@rklancer
rklancer / index.html
Last active December 20, 2015 20:08 — forked from tmcw/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>SVG Swarm</title>
<style>
svg {
position: absolute;
top: 0;
}
@rklancer
rklancer / gist:6096148
Created July 27, 2013 20:16
Rasbpi setup for internet over direct ethernet connection to a Mac running Mountain Lion
Lives at https://www.dropbox.com/s/nrnwn27vqal93mg/rasbpi-setup.txt
d/l latest raspbian from http://www.raspberrypi.org/downloads
connect sd card reader, then at the command line:
$ diskutil list
# identify the disk (not partition) of your SD card. e.g. disk2 (not disk2s1)
$ diskutil unmountDisk /dev/<disk# from diskutil>
$ sudo dd bs=1m if=<your image file>.img of=/dev/rdisk<disk # from diskutil>
@rklancer
rklancer / gist:4549097
Last active December 11, 2015 04:58
inquiry-space deploy:clean_and_update_all to lab2
lab (inquiry-space)$ cap lab2-dev deploy:clean_and_update_all
triggering load callbacks
* executing `lab2-dev'
triggering start callbacks for `deploy:clean_and_update_all'
* executing `multistage:ensure'
* executing `deploy:clean_and_update_all'
* executing `deploy:clean_and_update'
* executing "cd /var/www/app; git checkout inquiry-space; git pull origin inquiry-space"
servers: ["lab2.dev.concord.org"]
[lab2.dev.concord.org] executing command
@rklancer
rklancer / labjsfiles.txt
Created October 4, 2012 15:28
Lab js files (excluding energy2d files)
Files we definitely need:
---
src/lab/start.js
src/lab/end.js
src/lab/lab-module.js
src/lab/benchmark/benchmark.js
src/lab/components/button.coffee