Skip to content

Instantly share code, notes, and snippets.

View sfentress's full-sized avatar

Sam Fentress sfentress

  • Concord Consortium
View GitHub Profile
require 'builder'
def get_user_id(user_name)
# create_xml ("username_exists", user_name)
end
def create_blog_post(post_title, post_content, user_id)
var data = {
"post_title" => post_title,
"post_content" => post_content,
// STATES
//
// loggedOut
// loggedIn
// showingBlogButton <------------|- concurrent
// atLocation <------------|
// inHomePage
// inActivity
//
@sfentress
sfentress / gist:1203930
Created September 8, 2011 17:03
CC IRC Log 9/8/11
CIA-115: ==> rigse :: Stephen Bannasch rails3.0 * r005e5ff / (Gemfile Gemfile.lock)
[10:40am] CIA-115: (log message trimmed)
[10:40am] CIA-115: Gemfile: dynamic_form to restore some legacy Rails features
[10:40am] CIA-115: https://github.com/joelmoss/dynamic_form
[10:40am] CIA-115: ==> rigse :: Stephen Bannasch rails3.0 * r74ef4d4 / app/controllers/application_controller.rb
[10:40am] CIA-115: (log message trimmed)
[10:40am] CIA-115: restore legacy WillPaginate::Collection behavior
[10:40am] CIA-115: https://github.com/mislav/will_paginate/wiki/Backwards-incompatibility
[10:46am] stepheneb: If you are working on the rails3 stuff and have local commits you might want to:
[10:46am] stepheneb: git fetch; git rebase origin/rails3.0; git push origin rails3.0
xml = '<?xml version="1.0" encoding="UTF-8"?>' +
'<methodCall>' +
'<methodName>extapi.callWpMethod</methodName>' +
'<params>' +
'<param>' +
'<value>' +
'<string>rpc-admin</string>' +
'</value>' +
'</param>' +
'<param>' +
@sfentress
sfentress / index.html
Created November 14, 2011 15:08
JSON Schema validation + references
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JSON Schema validation + references</title>
<!-- load Dojo -->
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6.1/dojo/dojo.xd.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6.1/dojox/json/schema.js"></script>
<script>
window.onload=function() {
var doc, env, report, schema;
schema = {
"paneSchema": {
"type": "object",
"properties": {
"height": {
"type": "number"
}
}
schema = {
"properties": {
"topPane": {
"$ref": "paneSchema" // referring directly by a new id, not #/paneSchema
},
"bottomPane": {
"$ref": "paneSchema"
}
},
"paneSchema": {
@sfentress
sfentress / JSONPSensorServer.ino
Created March 19, 2012 20:09
Arduino Server for JSON-P pin values
/*
Web Server returning data as JSON-P, adapted from http://arduino.cc/en/Tutorial/WebServer
A simple web server that returns the value of the analog input pins as
a JSON-P object, using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13 (standard configuration)
* Analog inputs attached to pins A0 through A5 (optional)
* Example of reading LM35 on pin A0:
/*
sfentress: Set up: a piezoelectric or other speaker with one lead on ground and the other on pin D8
*/
/*
Melody
Plays a melody
circuit: