text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/home/danielpcox/.rvm/rubies/ruby-1.9.3-p0/bin/ruby | |
# ############# The Washington Post Downloader ############# | |
# | |
# Downloads and merges the day's Epaper into three sections. Ignores the Sports section. | |
# (requires pdftk, wget, and the nokogiri gem) | |
require 'open-uri' | |
require 'nokogiri' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem "sinatra" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Set this to your own project directory | |
PROJECT_DIR=/Users/jim/neo/development/neo4j-tutorial | |
LIB_DIR=$PROJECT_DIR/lib | |
java -cp $LIB_DIR/neo4j-jmx.jar:$LIB_DIR/neo4j-community.jar:$LIB_DIR/neo4j-server.jar:$LIB_DIR/neo4j-cypher.jar:$LIB_DIR/neo4j-kernel.jar:$LIB_DIR/neo4j-shell.jar:$LIB_DIR/neo4j-graph-algo.jar:$LIB_DIR/neo4j-lucene-index.jar:$LIB_DIR/lucene-core.jar:$LIB_DIR/neo4j-graph-matching.jar:$LIB_DIR/neo4j-server-static-web.jar:$LIB_DIR/scala-library.jar:$LIB_DIR/geronimo-jta_1.1_spec.jar org.neo4j.shell.StartClient -path $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SandboxApp | |
{ | |
private static Node node1; | |
private static RelationshipType relType = DynamicRelationshipType.withName("BEHOLD"); | |
public static void main( String[] args ) throws ParseException, JSONException | |
{ | |
RestAPI restAPI = new RestAPI("http://localhost:7474/db/data"); | |
node1 = restAPI.createNode(map()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<?xml-stylesheet type="text/xsl" href="events.xsl"?> | |
<!-- Or if I remove the namespace attributes on IncidentList, it works. --> | |
<IncidentList xmlns="http://wits.nctc.gov" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://wits.nctc.gov WITS.XSD"> | |
<Incident> | |
<ICN>200458431</ICN> | |
<Subject>10 civilians killed, at least 45 wounded by suspected GAM in Peureulak, Indonesia</Subject> | |
<Summary>On 1 January 2004, in Peureulak, Aceh Province, Indonesia, a bomb exploded at a concert, killing ten civilians, wounding 45 others, and causing major damage to the stage area. Many of the victims were Indonesian teenagers. Police blamed the Free Aceh Movement (GAM), although the GAM denied responsibility. No other group claimed responsibility.</Summary> | |
<IncidentDate>01/01/2004</IncidentDate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'awesome_print' | |
get %r{.*} do | |
puts_env | |
end | |
post %r{.*} do | |
puts_env | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static String readFileAsString(String filePath) | |
throws java.io.IOException{ | |
StringBuffer fileData = new StringBuffer(1000); | |
BufferedReader reader = new BufferedReader( | |
new FileReader(filePath)); | |
char[] buf = new char[1024]; | |
int numRead=0; | |
while((numRead=reader.read(buf)) != -1){ | |
String readData = String.valueOf(buf, 0, numRead); | |
fileData.append(readData); |
I did all of the following with Rails 3.2.12 and Bundler 1.3.0 acquired with
$> gem install --version '3.2.12' rails
$> gem install --version '1.3.0' bundler
Start by using Rails' Engine generator with a few options.
$> rails plugin new blorgh --full --dummy-path=spec/dummy \
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# USAGE: merge-remote.sh <subdirectory-name> <new-local-branch-name> <remote-branch-name> <remote-repository-url> | |
# | |
# <new-local-branch> will be created it it does not already exist | |
SUBDIR_NAME=$1 | |
LOCAL_BRANCH=$2 | |
REMOTE_BRANCH=$3 | |
REMOTE_URL=$4 |