Skip to content

Instantly share code, notes, and snippets.

View damienstanton's full-sized avatar

Damien Stanton damienstanton

View GitHub Profile
@damienstanton
damienstanton / Gruntfile.coffee
Last active August 29, 2015 14:20
PureScript Tasks
module.exports = (grunt) ->
"use strict"
grunt.initConfig({
# Source File Location
srcFiles: ["src/**/*.purs", "bower_components/**/src/**/*.purs"]
# Compiler Options
psc: {
@damienstanton
damienstanton / purs
Last active August 29, 2015 14:20
PureScript Scaffolding
#!/bin/bash
mkdir src; mkdir dist;
npm install grunt grunt-purescript
cat <<EOT>> Gruntfile.coffee
module.exports = (grunt) ->
"use strict"
grunt.initConfig({
# Source File Location
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_selector": "source - comment",
"auto_complete_triggers":
[
{
"characters": ".",
"selector": "source"
}
@damienstanton
damienstanton / frpnotes.md
Last active August 29, 2015 14:20
Functional Reactive Programming Notes

FRP Notes

Implementations in Scala, but conceptually should apply to all FP languages

Reactive programming is about reacting to sequences of events that happen in time

Functional view: Aggregate an event sequence into a signal.

A signal is a value that changes over time

// This sample will guide you through elements of the F# language.
//
// *******************************************************************************************************
// To execute the code in F# Interactive, highlight a section of code and press Alt-Enter in Windows or
// Ctrl-Enter Mac, or right-click and select "Send Selection to F# Interactive".
// You can open the F# Interactive Window from the "View" menu.
// *******************************************************************************************************
// For more about F#, see:
// http://fsharp.org
//
@damienstanton
damienstanton / scalenotes.md
Created May 11, 2015 17:04
Clojure At Scale - Notes

Clojure Structure Notes

Walmart Model

5,000 Stores

Redis + Cassandra Cache/DB

Component Model

[
// Fix some weirdness with advanced new file
// -----------------------------------------
{ "keys": ["super+alt+n"], "command": "advanced_new_file_new"},
{ "keys": ["shift+super+alt+n"], "command": "advanced_new_file_new", "args": {"is_python": true}},
// Make the sidebar behave more Vimlike
{ "keys": ["h"], "command": "move", "args": {"by": "characters", "forward": false}, "context":
@damienstanton
damienstanton / plus.clj
Created June 9, 2015 17:29
clojure joke
(let [+ (fn [& more] 5)] (+ 2 2))
@damienstanton
damienstanton / sourcefile.clj
Created June 10, 2015 15:57
Reader Conditionals
#?(:clj (println "Hello Java") ;; compiles to .jar
:cljs (println "Hello JavaScript") ;; compiles to .js
:clr (println "Hello .NET")) ;; compiles to .dll
(ns datascript-to-datomic-util
(:require [datascript :as d]))
;;;; a utility to help with a datomic-datascript roundtrip process involving:
;;; 1. export some data from a datomic database and transact into a datascript instance.
;;; 2. perform one or more transactions against datascript.
;;; 3. transact the sum of all changes made against datascript back into datomic in a single tx
;;; this namespace contains two public functions:
;;; listen-for-changes: listen to datascript transactions and build up a record of changes