Skip to content

Instantly share code, notes, and snippets.

View canadaduane's full-sized avatar

Duane Johnson canadaduane

View GitHub Profile
~/I/pandarus git:master ❯❯❯ ./build-and-install-gem
++ dirname ./build-and-install-gem
+ cd .
+ rm -f './clients/ruby/lib/pandarus/models/*.rb'
+ mvn clean package scala:run -Dlauncher=ruby-codegen
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building client-generator 1.0.0-SNAPSHOT
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wordnik</groupId>
<artifactId>client-generator</artifactId>
<packaging>jar</packaging>
<name>client-generator</name>
<version>1.0.0-SNAPSHOT</version>
<prerequisites>
<maven>2.2.0</maven>
-rw-r--r-- 1 duane staff 6938 Sep 13 14:29 001.create_books.sql
drwx------+ 54 duane staff 1836 Jan 29 09:30 Desktop
drwx------+ 17 duane staff 578 Jan 28 16:03 Documents
drwx------+ 65 duane staff 2210 Feb 21 14:15 Downloads
drwx------@ 17 duane staff 578 Feb 21 15:31 Dropbox
drwx------@ 61 duane staff 2074 Dec 3 09:21 Library
drwx------+ 3 duane staff 102 Jan 30 2013 Movies
drwx------+ 4 duane staff 136 Jan 30 2013 Music
drwx------+ 6 duane staff 204 Aug 9 2013 Pictures
lrwxr-xr-x 1 duane staff 29 Oct 15 2012 Projects -> /Users/duane/Dropbox/Projects
@canadaduane
canadaduane / .bashrc
Last active August 29, 2015 14:03
Ultimate Update Canvas Script
function is_git_dir() {
git rev-parse --is-inside-git-dir >/dev/null 2>&1 && [ -d .git ]
return $?
}
function is_canvas_root() {
CANVAS_IN_README=$(head -1 README.md 2>/dev/null | grep 'Canvas LMS')
[[ "$CANVAS_IN_README" != "" ]] && is_git_dir
return $?
}

I want internet service providers classified as common carriers. It's good for entrepreneurs, it's good for Americans, it's good for communities. It might not be good for a handful of very wealthy, aging media conglomerates. I'm ok with that. I will support you, as our appointed policy makers, in making a decision that they may not be happy with. Please continue down the path of Title II classification.

-- Duane Johnson Submitted to the FCC September 9th, 2014

@canadaduane
canadaduane / docker_start.sh
Last active August 29, 2015 14:06
docker_start.sh
docker rm -f changinx
docker run -d --name changinx \
-p 80:80 \
-v /r/logs:/var/log/nginx \
-v /r/conf:/conf \
wordtree/changinx
docker rm -f beanstalkd
docker run -d --name beanstalkd \
-p 11300:11300 \
@canadaduane
canadaduane / test.rb
Created November 12, 2014 18:15
Test array as argument value in pandarus
require 'pandarus'
$p = {
token: "YOUR_TOKEN",
prefix: "http://localhost:3000/api"
}
$c = Pandarus::Client.new($p)
# $c.retrieve_assignment_overridden_dates_for_quizzes(1)
result = $c.list_submissions_for_multiple_assignments_sections(1, {assignment_ids: [1, 2, 3, 4, 5, 6, 7, 8], student_ids: "all", include: ["assignment"]})
@canadaduane
canadaduane / slc_city_council.md
Created November 18, 2014 22:49
RideShare.opinion.txt

While the UTA provides increasingly better transit for our residents, and cabs provide a useful service, there is still a wide gap between "drive-yourselfers" and "public transiters". Shared rides with a hybrid for-pay model (à la Lyft) is an important new option for Salt Lake City that reduces traffic congestion and pollution. Please keep this option affordable as we explore new and innovative solutions to Utah's transit needs.

@canadaduane
canadaduane / question.md
Created January 2, 2015 04:38
Question for archive.org team

I'm curious if there has been any attempt to calculate a "scan quality" measure for the OCRed books in the archive. I deal frequently with data from the period 1700-1830 and I notice a wide variety in quality. Ideally, I'd like a "scanquality" property that I could set parameters for in a search.

I've implemented something like this for books that I've downloaded from archive.org, but it seems like it would be useful for all patrons of archive.org to have this metadata. Has implementing an algorithm like this been talked about? How interesting is it, and if interesting, with whom should I speak to develop something like this?

@canadaduane
canadaduane / test-ideas.js
Created March 4, 2015 15:58
Ideas for making testing in react/js easier
/*
Some of the pains I'm experiencing in testing JS:
- subject "appears out of nowhere" (as do "describe", "it", and "assert")
- it isn't clear what methods are available on subject
- stubs must happen outside of tests
- stubs take up a lot of space in test files
- stub methods require the developer to think about whether it's a class or component
- stubs require outside-scope closure capture of variable to be used in tests
- it isn't lexically clear where the stubbing "ends", e.g. the life cycle of a stubbed class method
- mountComponent doesn't automatically unmount?