Skip to content

Instantly share code, notes, and snippets.

View kolektiv's full-sized avatar
💭
Building myself a secondary brain...

Andrew Cherry kolektiv

💭
Building myself a secondary brain...
View GitHub Profile
@kolektiv
kolektiv / gist:2762765
Created May 21, 2012 14:55
SpahQL experiments
var spahql = require('spahql');
var response = {
_id: '0',
text: 'some text',
sources:
[
{
_id: '1',
innerText: 'some inner text'
@kolektiv
kolektiv / gist:2762802
Created May 21, 2012 15:02
SpahQL usefulness
var response = spahql.db(data);
response.select('//_id').renameAll('id');
response.select('//auth').destroyAll();
// return response.value();
package main
import (
"fmt"
"time"
)
func main() {
i := 0
t := time.Now()
@kolektiv
kolektiv / keybase.md
Last active August 29, 2015 14:07
Keybase Verification

Keybase proof

I hereby claim:

  • I am kolektiv on github.
  • I am kolektiv (https://keybase.io/kolektiv) on keybase.
  • I have a public key whose fingerprint is 622B DD92 AFB2 453A DFD9 2B42 EC8F 8458 216C 0FBD

To claim this, I am signing this object:

@kolektiv
kolektiv / Snowflake Code Dump
Created December 29, 2014 17:35
Snowflake Generation
module Cells =
// Types
type LifeSpec =
| LifeSpec of GenerationSpec list
and GenerationSpec =
| GenerationSpec of strength: int * liveness: (int -> bool)
@kolektiv
kolektiv / gist:171d536a64944c006011
Created March 11, 2015 09:27
Chiron single case union
type TestUnion =
| Union of string
type TestContainer =
{ Test: TestUnion }
static member FromJson (_: TestContainer) =
fun t ->
{ Test = Union t }
<!> Json.read "union"
@kolektiv
kolektiv / gist:3d28ae35657275ecc29c
Last active October 30, 2017 21:07
A content negotiated resource in Freya
open System
open System.Text
open Freya.Core
open Freya.Machine
open Freya.Machine.Extensions.Http
open Freya.Machine.Router
open Freya.Router
open Freya.Types.Http
open Microsoft.Owin.Hosting
type Example =
| IntCase of int
| StringCase of string
let intExample = IntCase 5 // type - Example
let stringExample = StringCase "hello"
type ExampleRecord =
{ ExampleField: Example }
let t2 =
TopicDescription "testtopic2"
let t3 =
TopicDescription "testtopic3"
let setup =
ServiceBus.run (
ServiceBus.liftNamespace (
Namespace.Topics.create t3
@kolektiv
kolektiv / monadic.fs
Created January 8, 2016 17:23
Overloading monadic operators?
// Implementations
module Reader =
let bind (f: 'e -> 't, binder: 't -> 'e -> 'u) : 'e -> 'u =
fun e ->
binder (f e) e
// Specializations