Skip to content

Instantly share code, notes, and snippets.

View canadaduane's full-sized avatar

Duane Johnson canadaduane

View GitHub Profile
@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 $?
}
-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
<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>
~/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
# lib/account_with_account_domains.rb:
Account.class_eval do
# ...
end
# init.rb:
configure_method = Proc.new do
::ApplicationController.promote_view_path File.dirname(__FILE__)+'/app/views'
require_dependency 'account_with_account_domains'
end
@canadaduane
canadaduane / gist:8190280
Created December 31, 2013 00:01
Possible JSON configuration for Bespoke
{
"index": {
"student_personal": ["ref_id"],
"student_personal": ["ref_id"],
"staff_personal": ["ref_id"],
"school_course_info": ["ref_id"],
"section_info": ["ref_id"],
"term_info": ["ref_id"],
"school_info": ["ref_id"],
"student_section_enrollment":
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require 'rubygems'
require 'bundler/setup'
load Gem.bin_path('sif_lord', 'sif_pump')
@canadaduane
canadaduane / segfault.rb
Created November 22, 2013 16:05
Example code that can usually cause a Nokogiri segfault
require 'openagent'
xml = <<-XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<SIF_Message xmlns="http://www.sifinfo.org/infrastructure/2.x" Version="2.0r1">
<SIF_Ack>
<SIF_Header>
<SIF_MsgId>D6530166E11C7E76AD542FE4B693000A</SIF_MsgId>
<SIF_Timestamp>2013-11-21T04:06:27</SIF_Timestamp>
$files.each do |filename|
File.open(filename) do |file|
first_line = true
file.each_line do |raw_line|
begin
if first_line
headers = CSV.parse_line(raw_line)
first_line = false
else
line = CSV.parse_line(raw_line, :headers => headers)
@canadaduane
canadaduane / trsst-qa.md
Last active December 22, 2015 16:49
Trsst Q&A

Q: The Tent.io team has put a lot of thought into getting the protocol for a distributed "you own your data" publishing platform right. Have you considered their approach or integrated any ideas from their protocol?

A: Yes, we're focused on extending RSS to support self-signing/encryption part on the client-side, but on the server-side we're specifying a way for http servers to relay RSS entries.

You'll note we're a bit vague on the second part because we've not yet determined whether to go with ostatus or tent or a least common denominator of those and other solutions. Note that none of those speak to PKI (as far as I've seen), and we're keen on using RSS as the transport format just so everything interops with all the RSS piping and code already out there. But we'll have time to focus on that when/if this funding closes.

Now I'm checking to see if I even answered your question -- ok, yes, we're definitely considering both the protocol and the ideas and implementation behind it.

Thanks for your interest,