Skip to content

Instantly share code, notes, and snippets.

View jimmyp's full-sized avatar

Jim Pelletier jimmyp

  • Melbourne, Australia
View GitHub Profile
public static class UselessStatefulScope // ;)
{
public static void ProcessRequest<T>(T Request)
{
//Resolve the validator & validate the request
var valid = Container.Resolve<IValidate<T>>();
if(!valid(Request))
throw new Exception();
//Resolve all the applicable processors and process them
@jimmyp
jimmyp / gist:1333614
Created November 2, 2011 13:25
corrected generic type of ProcessThatReportsItsProgress
public static class UselessStatefulScope // ;)
{
public static void ProcessRequest<T>(T Request)
{
//Resolve the validator & validate the request
var valid = Container.Resolve<IValidate<T>>();
if(!valid(Request))
throw new Exception();
//Resolve all the applicable processors and process them
@jimmyp
jimmyp / gist:2928207
Created June 14, 2012 05:56
$Error after changing directory to SQLSERVER:\sql using SqlServerSnappinswrite-ho
The term 'w' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
@jimmyp
jimmyp / gist:4147580
Created November 26, 2012 10:35
TypeScript talk for ALT. NET
//In the middle of a riduculous amount of silly dom traversal I have this line
$(this).find('.holder').find('h3:first > span:first-child').html('<strong>Priced from</strong> ' + theVal);
//More silly dom traversal
//The problem is that in IE8 when this line is executed the display is not updated, it renders sometime later (maybe after all js is finished?) in chrome and other browsers the new value is rendered as soon as this line is executed..
@jimmyp
jimmyp / gist:5538332
Created May 8, 2013 05:07
Ex 1.3 SICP
(define (max1 a b c)
(cond ((and (> a b)(> b c)) a)
((and (> a b)(> c b)) a)
(else c)))
(define (max2 a b c)
(cond ((and (> a b)(> b c)) b)
((and (> a b)(> c b)) c)
(else b)))
(define (square x) (* x x))
(define (sum-square a b) (+ (square a) (square b)))
@jimmyp
jimmyp / SICPEx1.1.rkt
Last active December 17, 2015 12:08
SICP 1.1 Exercises
; 1.1
; What is the result of each of the follow expressions
; 10 => 10
; (+ 5 3 4) => 12
; (- 9 1) => 8
; (/ 6 2) => 3
; (+ (* 2 4) (- 4 6)) => (+ 8 -2) => 6
; (define a 3)
; (define b (+ a 1))
; (+ a b (* a b))
@jimmyp
jimmyp / SICPEx1.2.rkt
Last active December 17, 2015 13:10
SICP 1.2 Exercises
; ex 1.11
(define (f n)
(if ((n < 3) n)
(else (+ (f (- n 1)) (* 2 (f (- n 2))) (* 3 (f (-n 3)))))))
; (f 4)
; (+ (f 3) (* 2 (f 2)) (* 3 (f 1)))
; (+ (+ (f 2) (* 2 (f 1)) (* 2 (f 0))) (* 2 2) (* 3 1))
; (+ (+ (f 2) (* 2 (f 1)) (* 2 (f 0))) 4 3)
; (+ (+ (f 2) (* 2 (f 1)) (* 2 (f 0))) 4 3)
@jimmyp
jimmyp / play apk
Last active October 13, 2017 07:49
play apk url
(http://www.apkmirror.com/apk/google-inc/google-play-store/google-play-store-7-2-13-j-xhdpi-8-pr-139098199-release/google-play-store-7-2-13-j-xhdpi-8-pr-139098199-android-apk-download/#description)[papk]
@jimmyp
jimmyp / TestAndImplemetation.cs
Created March 15, 2018 00:25
String CalcTDD Kata with the IQ Team
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace StringCalculator
{