Skip to content

Instantly share code, notes, and snippets.

var centralLocation = "http://central.com/~tav/central.html",
centralChannel,
messageId = 0,
messageQueue = [],
callbackRegistry = {},
firstContact = false;
function createCentralChannel() {
if (centralChannel) {
return;
@samrose
samrose / gist:1515518
Created December 23, 2011 22:17
form
= form_for @forum_topic do |f|
-if @forum_topic.errors.any?
#error_explanation
%h2= "#{pluralize(@forum_topic.errors.count, "error")} prohibited this forum_topic from being saved:"
%ul
- @forum_topic.errors.full_messages.each do |msg|
%li= msg
= hidden_field_tag "forum_topic[forum_id]", params[:forum_id]
.field
= f.label :title
@samrose
samrose / controller create
Created December 23, 2011 22:19
controller create
def create
#@forum = Forum.find(params[:forum_id])
#params[:forum_topic][:forum_id]
@forum_topic = ForumTopic.new(params[:forum_topic])
respond_to do |format|
if @forum_topic.save
format.html { redirect_to forum_forum_topic_path, notice: 'Forum topic was successfully created.' }
format.json { render json: @forum_topic, status: :created, location: @forum_topic }
else
@samrose
samrose / mvlogoutput
Created July 20, 2012 18:56
mvn log output
mvn clean compile exec:java -Dexec.mainClass="org.neo4j.examples.astarrouting.AStarRouting"
[INFO] Scanning for projects...
[WARNING] The POM for cuke4duke:cuke4duke-maven-plugin:jar:0.4.4 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for cuke4duke:cuke4duke-maven-plugin:0.4.4: Plugin cuke4duke:cuke4duke-maven-plugin:0.4.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for cuke4duke:cuke4duke-maven-plugin:jar:0.4.4
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Java A* routing example 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for cuke4duke:cuke4duke-maven-plugin:jar:0.4.4 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for cuke4duke:cuke4duke-maven-plugin:0.4.4: Plugin cuke4duke:cu
@samrose
samrose / README.md
Created August 11, 2012 15:38 — forked from jamesjohnson/README.md
Ubuntu 11.10, PostGIS 1.5 Setup Script

Installing PostGIS

Ubuntu 11.10

sudo apt-get install postgresql-9.1-postgis
sudo su postgres
bash <(curl -s https://raw.github.com/gist/18660599/create_template.sh)

Ubuntu 11.04

@samrose
samrose / gist:3693854
Created September 10, 2012 21:05
SMW 4store error
Unexpected non-MediaWiki exception encountered, of type "SMWSparqlDatabaseError"
exception 'SMWSparqlDatabaseError' with message 'A SPARQL query error has occurred
Query: PREFIX wiki: <http://198.61.166.168/assetdb/index.php/Special:URIResolver/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX swivt: <http://semantic-mediawiki.org/swivt/1.0#>
PREFIX property: <http://198.61.166.168/assetdb/index.php/Special:URIResolver/Property-3A>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
DELETE { wiki:Main_Page ?p ?o } WHERE { wiki:Main_Page ?p ?o }
@samrose
samrose / gh-pages-demo
Created November 20, 2012 00:59
These are the steps I took to create the repo in my command line
Sams-MacBook-Air:Desktop samrose$ git clone git@github.com:samrose/examplerepo.git
Cloning into examplerepo...
warning: You appear to have cloned an empty repository.
Sams-MacBook-Air:examplerepo samrose$ nano readme.md
Sams-MacBook-Air:examplerepo samrose$ git add .
Sams-MacBook-Air:examplerepo samrose$ git commit -am 'readme'
[master (root-commit) 35f5148] readme
Committer: Sam Rose <samrose@Sams-MacBook-Air.local>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
set nocompatible
syntax on
filetype on
filetype plugin on
filetype indent on
set sidescroll=1
set sidescrolloff=3
@samrose
samrose / .vimrc
Created February 17, 2013 03:30
.vimrc for ruby-vim setup using pathogen
execute pathogen#infect()
syntax on
filetype plugin indent on
set sw=2
set number
@samrose
samrose / gist:5445637
Created April 23, 2013 17:26
SCREAM!
dbg:tracer().
{ok,<0.164.0>}
(smc@Sams-MacBook-Air)3> dbg:p(all, c).
{ok,[{matched,'smc@Sams-MacBook-Air',139}]}
(smc@Sams-MacBook-Air)4> dbg:tpl(boss_router, x).
{ok,[{matched,'smc@Sams-MacBook-Air',12},{saved,x}]}
(smc@Sams-MacBook-Air)5> (<0.144.0>) call boss_router:set_controllers(<0.157.0>,["smc_participant_controller","smc_profile","smc_security_controller"])
(<0.144.0>) returned from boss_router:set_controllers/2 -> ok
(<0.144.0>) call boss_router:reload(<0.157.0>)
13:25:06.391 [info] Loading routes from "/Users/samrose/Desktop/smc_chicagoboss/smc/priv/smc.routes" ....