Skip to content

Instantly share code, notes, and snippets.

View erjjones's full-sized avatar

Eric Jones erjjones

  • Indianapolis, Indiana
View GitHub Profile
@erjjones
erjjones / Contacts.sql
Created August 29, 2012 04:04
Sample Contacts Table for the Get Collection Store Procedure
CREATE TABLE dbo.Contacts (
ContactID int IDENTITY (1,1) NOT NULL,
FirstName nvarchar(64) NULL,
LastName nvarchar(64) NULL,
Phone nvarchar(50) NULL,
[Address] nvarchar(128) NULL,
City nvarchar(50) NULL,
[State] nvarchar(50) NULL,
Zip nvarchar(50) NULL,
Country nvarchar(128) NULL,
@erjjones
erjjones / ContactsTest.sql
Created August 29, 2012 04:05
Sample Contacts Testing Script
DECLARE @Count int, @Sort NVARCHAR(45), @Direction BIT, @Page INT, @PageSize INT
/* ---------------------------------------
USE THE VARIABLES BELOW TO TEST
CHANGE THEM TO SEE HOW THE RESULT
SET CHANGES ...
--------------------------------------- */
SET @Sort = 'FirstName'
SET @Direction = 0 -- ASC = 1, DESC = 0 OR NULL
@erjjones
erjjones / ContactsSelCollection.sql
Created August 29, 2012 14:58
Sample Get Collection Store Procedure
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE ContactsSelCollection
@Page INT = NULL,
@PageSize INT = NULL,
@Sort NVARCHAR(45) = NULL,
@Direction BIT = NULL,
@erjjones
erjjones / first_post.html
Created September 5, 2012 16:37
Get First Post Ruby
{% assign first_post = site.posts.first %}
{{ first_post.title }}
{{ first_post.date | date: "%B %e, %Y" }}
{{ first_post.summary }}
{% for post in site.posts offset: 1 limit: 50 %}
{{ post.title }}
{{ post.date | date: "%B %e, %Y" }}
{% for tag in post.tags %}
@erjjones
erjjones / fuelux-template.html
Created October 23, 2012 16:45
FuelUX Template
<!DOCTYPE html>
<html class="fuelux" lang="en"> <!-- FuelUX attribute -->
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="http://fuelux.exacttargetapps.com/fuelux/2.0/css/fuelux.css" rel="stylesheet" /> <!-- FuelUX CDN link to core css -->
@erjjones
erjjones / electric_imp_system_light
Created January 19, 2013 16:35
Electric Imp System Light
////////////////////
/// System Light ///
////////////////////
ledState <- 0; // Variable to represent LED state
inhibit <- 0; // Variable to represent LED inhibit state
hardware.pin9.write(1); // System Light
// input class for LED control channel
@erjjones
erjjones / electric_imp_system_ping
Last active December 11, 2015 20:38
Awake Imp post JSON payload
function getDateTime(){
local d = date();
local datestring = format("%04d-%02d-%02dT%02d:%02d:%02d", d.year, d.month+1, d.day, d.hour, d.min, d.sec); //ISO 8601
return datestring;
}
class RespInput extends InputPort
{
name = "response";
type = "string";
@erjjones
erjjones / guide-workspaces-sample.json
Created April 22, 2014 02:30
Guide to Workspaces Sample
{
"WorkspaceUri": "Sample",
"Title": "Sample Title",
"Description": "This is a sample workspace.",
"Anonymous": false,
"EnableTriggers": false,
"Records": 0,
"Collections": [
{
"CollectionUri": "Products",
@erjjones
erjjones / Triggers
Created August 27, 2014 02:31
Default Trigger Class
using System;
using ODataHQ.Code.Common;
public class Triggers : ITriggers
{
public void Create(ExecutionContext context)
{
context.Execute();
}
@erjjones
erjjones / GarageDoor-Agent
Last active August 29, 2015 14:05
Home Monitor Garage Door Electric Imp Device
const ODATAHQ_URL = "https://query.odatahq.com/v3/{accountkeyhere}/homemonitor/garagedoor?api-key={apikeyhere}";
// Print light reading trigger URL
server.log("Sensor Agent URL: " + http.agenturl());
// Define funtions
function requestHandler(request, response)
{
// Handle an incoming web request for a reading
try