Skip to content

Instantly share code, notes, and snippets.

View leereilly's full-sized avatar

Lee Reilly leereilly

View GitHub Profile
@leereilly
leereilly / NormalSequenceExample.n3
Created April 6, 2011 16:55
What I'm trying to get my serialized RDF graph to look like
@prefix dms: <http://example.stanford.edu/ns/> .
@prefix ore: <http://www.openarchives.org/ore/terms/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://dmstech.groups.stanford.edu/ccc001/manifest/NormalSequence> a dms:Sequence,
ore:Aggregation,
rdf:List;
ore:aggregates <http://example.stanford.edu/item/DOC001/1V>,
<http://example.stanford.edu/item/DOC001/1R>,
<http://example.stanford.edu/item/DOC001/2V>,
@leereilly
leereilly / gist:987094
Created May 23, 2011 17:21 — forked from oisin/gist:952572
API version checking using Sinatra's before filter; supports nested resources
require 'sinatra'
# Set the version of the API being run here
#
MAJOR_VERSION = 1
MINOR_VERSION = 0
helpers do
def version_compatible?(nums)
return MAJOR_VERSION == nums[0].to_i && MINOR_VERSION >= nums[1].to_i
@leereilly
leereilly / jquery.lifestream.js
Created July 8, 2011 00:34
JQuery Lifestream
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script src="https://raw.github.com/christianv/jquery-lifestream/master/jquery.lifestream-compiled.js"></script>
<script>
$("#lifestream").lifestream({
list:[
{
service: "github",
user: "leereilly"
},
{
@leereilly
leereilly / coderwall.html
Created July 8, 2011 03:39
Coderwall Badge Script for Blogs (or any other Web Page)
<script>
// This is a fork of https://gist.github.com/1005886
var coderwallJSONurl ="http://www.coderwall.com/hermanjunge.json?callback=?";
var height = 75;
var width = 75;
$(document).ready(function(){
$.getJSON(coderwallJSONurl, function(data) {
$.each(data.data.badges, function(i, item) {
@leereilly
leereilly / Questions.md
Created July 13, 2011 19:00
Magma Rails Give-away

Day Job: Software developer @ Stanford.

Open Source contribution (if any): Various code/documentations contributions verifiable via GitHub:

@leereilly
leereilly / Photovine_2011-07-25-122804_Stanford-Phone.crash
Created August 1, 2011 16:58
Photovine_2011-07-25-122804_Stanford-Phone.crash
Incident Identifier: B0163859-41C2-48C2-938F-FD4DF5629AE2
CrashReporter Key: ec72c2d4ebeb3b104166c025307b5380bc27b2bf
Hardware Model: iPhone3,1
Process: Photovine [1620]
Path: /var/mobile/Applications/98BB1F73-7452-48E8-A928-7E0C5605E085/Photovine.app/Photovine
Identifier: Photovine
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
@leereilly
leereilly / load-tests.md
Created August 8, 2011 19:16
Google vs. Parker Load vs. ImageStacks Load Tests

Simple load testing with ab -n [TOTAL_NUMBER_OF_REQUESTS] -c [NUMBER_OF_CONCURRENT_REQUESTS] [URI]

Summary

  • ImageStacks TEST can't can't handle more than 10 concurrent requests for large images (it will timeout for most users and be slow for a handful of users).
  • Tiled images are fine (fast response time and can handle over 50 concurrent requests), unless another ImageStacks request e.g. thumbnail view or large view is blocking.

Recommendation

  • Don't use thumbnails - this will reduce the load on ImageStacks. They're unnecessary if the training session is to demonstrate the ZPR viewer.
@leereilly
leereilly / git-setup.sh
Created August 16, 2011 17:48
Git setup niceties
# via https://gist.github.com/419201#file_gitconfig.bash
# Install (from Matt's gist) these useful Git aliases & configurations with the following command:
# $ bash <(curl -s https://raw.github.com/gist/419201/gitconfig.bash)
git config --global color.ui auto # colorize output (Git 1.5.5 or later)
git config --global color.interactive auto # and from 1.5.4 onwards, this will works:
echo "Set your name & email to be added to your commits."
echo -n "Please enter your name: "
@leereilly
leereilly / gist:1187388
Created September 1, 2011 21:49
DWT SOAP Request (Production)

The URI below http://baseline-test.deepwebaccess.com/strata_baseline-test/services/searchService.wsdl is obviously incorrect; can you tell me what it should be for xsearch.stanford.edu? I've tried a few combinations e.g. http://xsearch.stanford.edu/strata_xsearch/services/searchService.wsdl, http://xsearch.stanford.edu/xsearch/services/searchService.wsdl with no luck.

<pre>

<?php
try {
  $sClient = new SoapClient('http://baseline-test.deepwebaccess.com/strata_baseline-test/services/searchService.wsdl');
  $params = "genome";
  $response = $sClient->search($params);

var_dump($response);

@leereilly
leereilly / test.rb
Created September 19, 2011 00:41 — forked from tenderlove/test.rb
require 'thread'
require 'json'
require 'net/http'
require 'uri'
require 'betabrite'
require 'psych'
require 'usb'
class StreamClient
def initialize user, pass