Skip to content

Instantly share code, notes, and snippets.

View jrsconfitto's full-sized avatar

James Sconfitto jrsconfitto

View GitHub Profile
@jrsconfitto
jrsconfitto / amplify.store.js
Last active December 11, 2015 13:38
AmplifyJS store bug on Android
/*!
* Amplify Store - Persistent Client-Side Storage 1.1.0
*
* Copyright 2011 appendTo LLC. (http://appendto.com/team)
* Dual licensed under the MIT or GPL licenses.
* http://appendto.com/open-source-licenses
*
* http://amplifyjs.com
*/
(function( amplify, undefined ) {
@jrsconfitto
jrsconfitto / index.html
Created December 6, 2012 17:49
Why can't i get this working?
<html>
<head>
<style type="text/css">
.chart rect {
stroke: white;
fill: steelblue;
}
.line {
fill: none;
@jrsconfitto
jrsconfitto / LoginModule.vb
Created November 6, 2012 19:56
Nancy Authentication issues i'm having
Imports Nancy
Imports Nancy.Authentication.Forms.ModuleExtensions
Imports Nancy.Extensions
Imports Nancy.Security
Imports System.Dynamic
''' <summary>
''' Handles all security related requests
''' </summary>
Public Class Login
@jrsconfitto
jrsconfitto / RxUIExamples.md
Created October 9, 2012 20:33
RxUI Examples

Rx UI Examples

Examples for me since i can't seem to remember how the basics work!

WhenAny

@jrsconfitto
jrsconfitto / Tweets.cs
Created June 7, 2012 20:13
Grab a Twitter search result using RestSharp and some json classes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RestSharpLearning
{
public class Metadata
{
public string result_type { get; set; }
@jrsconfitto
jrsconfitto / tabfieldcount.rb
Created March 13, 2012 19:50
Will count the number of tab delimited fields in the passed file name
#! ruby
if ARGV.length == 1
if File.exists?(ARGV[0])
file = File.open(ARGV[0], "r")
puts "File name: #{ARGV[0]}"
count = 1
file.each do |line|
line_count = line.split("\t").count
@jrsconfitto
jrsconfitto / programmingAF.md
Created January 23, 2012 14:18
Programming PI AF

Programming PI AF

Just a few things that i'm learning

Event Frame Reference:

  • Built into the AF SDK.
  • Uses packages:
    • OSIsoft.AF.UI
  • OSIsoft.AFSDK
@jrsconfitto
jrsconfitto / GetUniqueOPCMethods.rb
Created November 14, 2011 21:47
Grab the unique OPC methods from an exported OPC Analyzer trace
#! ruby
#
# Gets the unique OPC methods from the OPC analyzer trace log of all the methods TopView Configurator and Engine uses
# Assumes that it has been given a valid file name
if ARGV.length == 1 and File.exists?(ARGV[0])
input = File.open(ARGV.first, "r").read
# Build up a unique array of OPC methods
opc_methods = []
@jrsconfitto
jrsconfitto / RandomNumberSet.rb
Created September 26, 2011 13:57
This will generate random data that is timestamped in a CSV
#! ruby
# This will generate a negative number set that i can use for testing my compression analysis
#
# Example:
# NegNumSet numberOfPoints [max] [freq]
#
# Arguments (all are optional so far):
# 1: numberOfPoints - the number of points to generate
# 2: Max - the maximum distance from zero that the data point values can have
@jrsconfitto
jrsconfitto / chop.rb
Created June 13, 2011 22:09
Code Kata Two solutions
class Chop
def chop(target, values)
size = values.size
if size == 0
-1
elsif size == 1
(values[0] == target ? 0 : -1)
else
if target < values[size/2]