Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View programatt's full-sized avatar
😃
Code is neat.

Matt Phillips programatt

😃
Code is neat.
View GitHub Profile
@programatt
programatt / setup-linux.sh
Last active August 29, 2015 14:00
Setup clojure on a debian variant of linux
#!/bin/bash
sudo apt-get update
sudo apt-get install openjdk-7-jdk
mkdir temp
cd temp
wget https://raw.github.com/technomancy/leiningen/stable/bin/lein
sudo mv lein /usr/bin/lein
sudo chmod a+x /usr/bin/lein
cd ~
rm -rf temp
/*!
* Bootstrap v3.2
*
* Copyright 2014 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world by @mdo and @fat.
* BootSwatchr built and provided by @DrewStrickland
*//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border
@programatt
programatt / euroVersusSandPindicator
Created October 14, 2011 06:11
thinkScript $ES_F vs $6E_F indicator
#This script will plot the change in Euro FX Futures versus the change in emini S&P futures
declare lower;
input eu = "/6E";
input sp = "/ES";
plot data =(close(eu)-close(eu)[1])*1000;
plot Data2 = (close(sp)-close(sp)[1]);
@programatt
programatt / gist:1297428
Created October 19, 2011 03:41
What if science was capitalist?
It's true. Remember that the so called "speed of light" was imposed by an atheist jew intellectual, and has since been propped up by an academic elitist cabal supported by big government's tax-and-spend agenda. In fact, the entire enterprise of physics is inherently statist. It spends essentially all its time and resources imposing as many universal laws as possible. If only physics were deregulated, and the behavior of matter and energy left to the free market, those particles whose behavior is best adapted to the demands of the marketplace would outcompete less efficient matter and create a utopia.
@programatt
programatt / gist:1566149
Created January 5, 2012 17:05
Why does resharper think this is wrong?
catch (WebException e)
{
if(e.Response != null)
{
//resharper claims next line "Possible null assignment to entity
//marked with NotNull attribute.
//makes no sense to me because i'm checking null first
var r = new StreamReader(e.Response.GetResponseStream());
var data = r.ReadToEnd();
@programatt
programatt / messedup.cs
Created February 8, 2012 05:37
Data Model problems
using System;
using System.ComponentModel;
namespace ProblemChild.Models
{
public class FinancialProductBase
{
public int Id { get; set; }
public DateTime Timestamp { get; set; }
public string TraderName { get; set; }
@programatt
programatt / winning.cs
Created February 17, 2012 04:26
Instrument with property access
public class Instrument : DynamicObject
{
public int FinancialInstrumentId { get; private set; }
public string SpecialType { get; private set; }
public Instrument(int finId,string specialType)
{
FinancialInstrumentId = finId;
SpecialType = specialType;
@programatt
programatt / gist:3129683
Created July 17, 2012 14:22
Jabbr user count every 10 seconds
setInterval(function(){
var totalPop = 0
, roomPops = $('#userlist-lobby .room .count').text().match(/\d+/g);
for (var i = 0, l = roomPops.length; i < l; i++) {
totalPop += parseInt(roomPops[i]);
}
console.log(totalPop);
},10000);
@programatt
programatt / gist:3130222
Created July 17, 2012 15:49
Jabbr Users 10 Seconds
setInterval(function(){
var totalPop = 0
, roomPops = $('#userlist-lobby .room .count').text().match(/\d+/g);
for (var i = 0, l = roomPops.length; i < l; i++) {
totalPop += parseInt(roomPops[i]);
}
console.log(totalPop);
},10000);
@programatt
programatt / TestableTypeFactory.cs
Created August 23, 2012 01:29
Any order mocked construction parameters
using System;
using System.Linq;
using Moq;
using Xunit;
namespace Tests.UnitTests.Services
{
public class TestableTypeFactory
{
public static T GetType<T>(params object[] constructorParameters)