Skip to content

Instantly share code, notes, and snippets.

@smies
smies / designer.html
Last active August 29, 2015 14:11
designer
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-slider/paper-slider.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
@smies
smies / gist:354227a3616710f73982
Created August 7, 2014 11:23
Verifying myself: My Bitcoin username is +jamessmith. https://onename.io/jamessmith
Verifying myself: My Bitcoin username is +jamessmith. https://onename.io/jamessmith

Keybase proof

I hereby claim:

  • I am smies on github.
  • I am jsmith (https://keybase.io/jsmith) on keybase.
  • I have a public key whose fingerprint is F131 F1E5 5010 339B 8B0F 6278 6D31 8183 BC10 C61B

To claim this, I am signing this object:

@smies
smies / gist:6920243
Created October 10, 2013 15:24
Get angular gist in console
ngSocket = angular.element('html').injector().get('socket')
@smies
smies / PropositionalLogic.fs
Created April 23, 2013 12:52
Active patterns to hide optimised implementation. From Expert F# 3.0
open System.Collections.Generic
type Prop =
| Prop of int
and PropRepr =
| AndRepr of Prop * Prop
| OrRepr of Prop * Prop
| NotRepr of Prop
| VarRepr of string
| TrueRepr
@smies
smies / FourTreeSizes.fs
Created April 23, 2013 11:26
From Expert F# 3.0
type Tree =
| Node of string * Tree * Tree
| Tip of string
let rec sizeNotTailRecursive tree =
match tree with
| Tip _ -> 1
| Node(_, treeLeft, treeRight) ->
sizeNotTailRecursive treeLeft + sizeNotTailRecursive treeRight
// setup the active patterns
let (|MultOf3|_|) i = if i % 3 = 0 then Some MultOf3 else None
let (|MultOf5|_|) i = if i % 5 = 0 then Some MultOf5 else None
// the main function
let fizzBuzz i =
match i with
| MultOf3 & MultOf5 -> printf "FizzBuzz, "
| MultOf3 -> printf "Fizz, "
| MultOf5 -> printf "Buzz, "
let (|Fizz|_|) n = if n % 3 = 0 then Some("Fizz") else None
let (|Buzz|_|) n = if n % 5 = 0 then Some("Buzz") else None
let FizzBuzz n =
match n with
| Fizz f & Buzz b -> f + b
| Fizz f -> f
| Buzz b -> b
| _ -> string n
@smies
smies / Program.cs
Last active December 15, 2015 13:08
Continuation monad in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
public static class Program
{