Skip to content

Instantly share code, notes, and snippets.

@msarchet
msarchet / XLinqExtensions
Created April 23, 2011 18:41
XLinq Extensions
using System;
using System.Linq;
using System.Xml.Linq;
using System.Runtime.CompilerServices;
using System.Diagnostics;
//This class is simply used as a demonsration on how to use the extensions
public class Foo
{
public static void Main()
@msarchet
msarchet / scheduleByFacility.sql
Created October 11, 2011 15:23
Schedule Facility Query
Select
RXInfo.Patient,
RXInfo.Number,
Facility.Name,
RxInfo.RefillNumber
From scriptassist.RXInfo AS RXInfo
Left Join scriptAssist.Patient As PatientT On PatientT.PatientId = RXInfo.PatientID
Left Join scriptAssist.Facility On Facility.FacilityID = PatientT.FacilityID
Where
RXInfo.Schedule In ('2','3','4','5')
@msarchet
msarchet / count.html
Created November 16, 2011 22:04
Count super fast
<html>
<script type="text/javascript">
function countToFiveBillion(counter, num){
if(num < 5000000000)
{
num++;
if(num % 18700 == 0){
counter.innerHTML = num;
setTimeout(function() {countToFiveBillion(counter, num)}, 1);
} else {
@msarchet
msarchet / getPrice.sql
Created December 16, 2011 19:26
getPrice
USE [RxDataSQL]
GO
/****** Object: StoredProcedure [scriptassist].[getPrice] Script Date: 12/16/2011 12:15:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [scriptassist].[getPrice]
@msarchet
msarchet / temp.html
Created January 24, 2012 01:45
streamfire
function streamInfo(stream) {
var self = this;
self.name = stream.name;
};
function getStream(streamName){
return [{name: streamName}];
}
@msarchet
msarchet / Example4.html
Created May 9, 2012 16:39
Example 4 for the knockout talk
<!DOCTYPE html>
<script src="http://github.com/downloads/SteveSanderson/knockout/knockout-2.0.0.js"></script>
<script src="https://raw.github.com/bestiejs/lodash/master/lodash.js"></script>
<table >
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Phones</th>
</tr>
<tbody data-bind="foreach: contacts">
@msarchet
msarchet / PosisitonIt.js
Created September 24, 2012 20:32
A Javascript Function to position one element around a different element
function positionIt($element, $anchorElement, verticalPercent, horizontalPercent)
{
if(!($localElement instanceof jQuery))
{
throw '$element must be a jQuery object';
return;
}
if(!($anchorElement instanceof jQuery))
{
@msarchet
msarchet / quicktip.js
Created October 16, 2012 01:22
Quick Tooltip positioning start
function quicktip(options) {
var verticalPercent = '0';
var horizontalPercent = '0';
var stick = false;
if(options.verticalPercent !== undefined)
{
verticalPercent = options.verticalPercent;
}
@msarchet
msarchet / Users.cs
Created November 13, 2012 21:35
Trying to find a better way to do this
/*
I am using the cache here as a persistence layer, so I need to have a deterministic way at minimum
of knowing where to look for an object.
Problems that I already know exist: Currently I risk overwriting a list that has different items, perhaps I should only add and remove from teh Update section?
Thoughts better ways of handling the item changes from the time I fetch them from the cache until I read it from the cache.
Maybe instead of modifying the list I read out of the cache I should just send the update directly to the cache?
@msarchet
msarchet / APIExamples.cs
Created November 19, 2012 16:25
An abstraction over ServiceStacks IRedisList to provide cleaner connection handling
/*
** This exists to show differences in how to access HybridList<T> vs the standard IRedisList<T>
*/
//Adding items
//IRedisList<T>
using(var redis = new RedisClient())