Skip to content

Instantly share code, notes, and snippets.

View drobbins's full-sized avatar

David Robbins drobbins

  • Health Informatics - Samford University | @EmerioGroup
  • Birmingham, AL
View GitHub Profile
@drobbins
drobbins / index.html
Created November 23, 2011 16:46
Parsing remote HTML into a DOM
<!DOCTYPE html>
<html>
<head>
<title>CORS to DOM</title>
</head>
<body><div class="container">
<div id="login" class="span-24 last" style="text-align:right" ></div>
<div id="content"></div>
<script type="text/javascript">
//(function(){
@drobbins
drobbins / command_line_dump.md
Created March 8, 2012 15:06
Bug Demo: rdfstore-js
node rdfstoretest.js 
Attempting to create store...

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Cannot read property 'arbiterOnly' of undefined
    at /Users/robbinsd/Dropbox/Repos/rdfstorenode/node_modules/rdfstore/node_modules/mongodb/lib/mongodb/connection/server.js:552:22
 at [object Object].checkoutReader (/Users/robbinsd/Dropbox/Repos/rdfstorenode/node_modules/rdfstore/node_modules/mongodb/lib/mongodb/connection/server.js:569:16)
@drobbins
drobbins / index.html
Created April 9, 2012 18:41
Quanah + jQuery Interaction Bug Demo
<html>
<head>
<title>jQuery + Quanah Error Demo</title>
</head>
<body>
<a id="awesome">Click for Awesome</a>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="https://raw.github.com/wilkinson/quanah/master/src/quanah.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
(function(){
@drobbins
drobbins / readme.md
Created March 7, 2013 17:23
How to clean up duplicate but unlinked PDF files from your Papers2 library.

Papers2 Library Cleanup

For a variety of reasons, my Papers2 library folder (~/Library/Application Support/Papers2) was cluttered with many duplicate papers, generally only one of which was linked to a document in Papers2. Here is how I cleaned it up.

  1. From a Terminal, cd ~/Library/Application\ Support.
  2. open .
  3. Copy the Papers2 folder to the Desktop. This is your backup.
  4. In Papers2, cmd+,, select Library, select Add next to "Rename files in library folder as:", and select Separator -> _ then click Apply.
  5. Back in your Terminal, find ./ -iregex ".*[^_]\.pdf" -delete
  • If you want to see what's going to be deleted before doing it, run find ./ -iregex ".*[^_]\.pdf"
@drobbins
drobbins / Makefile
Last active December 20, 2015 15:48
Makefile that creates a script (sigsur2ag.sh) to send a SIGUSR2 signal to each running AG process.
always:
processes.txt: always
ps axf > processes.txt
script: processes.txt
awk 'BEGIN {print "#!/bin/bash";} /AG/ { print "kill -s sigusr2",$$1 }' processes.txt > sigsur2ag.sh
chmod +x sigsur2ag.sh
@drobbins
drobbins / coffeeexpress.coffee
Last active December 22, 2015 01:08
Sinatra vs. Express + Coffeescript.
app = require('express')()
app.get '/hi', (req, res) ->
res.end "Hello World"
@drobbins
drobbins / este_module.js
Last active August 29, 2015 14:00
Simple Meteor/IPE Module
myPatients = Patients.find().fetch();
numPatients = myPatients.length;
console.log("Hello from a module in Este. There are", numPatients, "patients available.");
package atmmachine;
import java.util.Date;
import java.util.Scanner;
/**
*
* @author Madai
*/
public class AtmMachine {
private int id;
@drobbins
drobbins / AtmMachine.java
Last active August 29, 2015 14:02
ATM Machine
public class AtmMachine {
Account[] accounts;
public static void main(String[] args) {
int command;
int id;
for (int i=0; i<10; i++) {