Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Post Ex-Dividend Profit on Single Share" />
<script type="text/javascript" src="//www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', {packages: ['corechart']});
</script>
<meta charset=utf-8 />
<title>JS Bin</title>
@jlyonsmith
jlyonsmith / ExpandoObjectHelper.cs
Last active August 29, 2015 13:56
ExpandoObjectHelper
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Xml.Linq;
namespace ToolBelt.Dynamic
{
//
// This class came from http://www.codeproject.com/Articles/461677/Creating-a-dynamic-object-from-XML-using-ExpandoOb
@jlyonsmith
jlyonsmith / S3Helper.cs
Created February 11, 2014 04:33
S3Helper
using System;
using System.Net;
using System.Net.Http;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using ToolBelt;
using System.IO;
@jlyonsmith
jlyonsmith / toaster.rb
Created April 8, 2014 06:41
Homebrew formula for Toaster unit test tools
require 'formula'
class Csharptools < Formula
homepage "http://jlyonsmith.github.io/Toaster/"
url "https://s3-us-west-2.amazonaws.com/jlyonsmith/Toaster-2.0.20407.tar.gz"
sha1 "aeadb20cf4cfbf9886a2d60c30c4b883fcd5196a"
def install
mono_path = `/usr/bin/which mono`.strip
if mono_path.size == 0 || `#{mono_path} --version`.index(/3\./) == nil
@jlyonsmith
jlyonsmith / RedisCacheClient.cs
Created August 19, 2014 09:59
ICacheClient for ServiceStack using StackExchange.Redis
using System;
using System.Collections.Generic;
using ServiceStack.Caching;
using StackExchange.Redis;
using ServiceStack.Text;
using System.Linq;
namespace Shared.ServiceInterface
{
public class RedisCacheClient : ICacheClient, IRemoveByPattern
require 'formula'
class Vacuum < Formula
homepage "http://github.com/jlyonsmith/Vacuum"
url "https://s3-us-west-2.amazonaws.com/jlyonsmith/Vacuum-3.0.20307.tar.gz"
sha1 "e24bc5621753fbee9166e4dc2bf5dcc9ee426016"
def install
mono_path = `/usr/bin/which mono`.strip
if mono_path.size == 0 || `#{mono_path} --version`.index(/3\./) == nil
require 'formula'
class Soapbox < Formula
homepage "http://github.com/jlyonsmith/Soapbox"
url "https://s3-us-west-2.amazonaws.com/jlyonsmith/Soapbox-1.0.20302.tar.gz"
sha1 "b146ce78122a19ec104e9bf6be73fd0c1ef9acd4"
def install
mono_path = `/usr/bin/which mono`.strip
if mono_path.size == 0 || `#{mono_path} --version`.index(/3\./) == nil
require 'formula'
class Codetools < Formula
homepage "http://jlyonsmith.github.io/CodeTools/"
url "https://s3-us-west-2.amazonaws.com/jlyonsmith/CodeTools-3.0.10708.tar.gz"
sha1 "32e70ffdd931fa6b3928d50b04d3e567ec37f471"
def install
mono_path = `/usr/bin/which mono`.strip
if mono_path.size == 0 || `#{mono_path} --version`.index(/3\./) == nil
@jlyonsmith
jlyonsmith / ImageTools.cs
Created August 17, 2012 17:16
Function to rotate an image using Cairo in C#/Mono.
public enum ImageRotation
{
None,
Left,
Right,
UpsideDown
}
public class ImageTools
{
public func Log<T>(item: T, fileName: String = __FILE__, line: Int = __LINE__, funcName:String = __FUNCTION__) {
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "MM/dd/yyyy HH:mm:ss:SSS"
let process = NSProcessInfo.processInfo()
let threadId = "?"
var shortFileName = (NSURL(string: fileName)?.lastPathComponent?.componentsSeparatedByString(".").first)
if shortFileName == nil {
shortFileName = "unknown"
}