Skip to content

Instantly share code, notes, and snippets.

@seanhess
seanhess / Makefile
Created April 11, 2014 23:17
Deploy Stuff
install:
npm install
upload:
# sync all the files
rsync -rav -e ssh --delete --exclude-from config/exclude.txt . root@dev.orbit.al:~/spoticka
deploy: upload
# run the remote commands
ssh -t root@dev.orbit.al "cd ~/spoticka && bash config/deploy.sh"
@seanhess
seanhess / hintprint.conf
Created May 6, 2014 21:51
Example API upstart script
description 'Hint of Print API'
start on runlevel [2345]
stop on runlevel [06]
limit nofile 10000 15000
respawn
respawn limit 5 5
env NODE_ENV=production
env PORT=80
chdir /root/hintprint
exec /usr/bin/node server/api.js >> /var/log/hintprint-api.log 2>&1
@seanhess
seanhess / fib.hs
Created June 3, 2014 14:22
Fib Haskell
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
import _ = require('lodash')
export interface ModalConfig {
modalUrl:string;
state:string;
}
export interface Modal {
modalUrl: string;
state: string;
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
import qualified Web.Scotty
import Web.Scotty.Trans
import Data.Text.Lazy
import Courses.Course
import Courses.Connection
import Control.Monad.IO.Class (liftIO)
macro export {
rule { var $x } => {var $x = exports.$x}
rule { function $x } => {exports.$x = function $x}
}
export export
(ns svg.core
(:require [goog.dom :as dom]))
(enable-console-print!)
(println "Hello world!")
(defn main []
(let [root-view (dom/getElement "root")]
(.log js/console root-view)
@seanhess
seanhess / history.json
Created October 20, 2014 15:06
history
[
{
"date": "2014-10-20T14:54:20.263Z",
"diff": {
"department": "AAA",
"learningUnits": 5,
"name": "Big Bad Course",
"number": "109"
},
"version": 0
// structure is an immstruct
// App is an omniscient component
var Main = page(structure, function(params) {
loadSomething(params.id, structure.cursor())
return function() {
return App(structure.cursor())
}
})
@seanhess
seanhess / Euler12.hs
Last active August 29, 2015 14:08
Euler 12
module Euler where
import Control.Monad
import Data.List
import Data.Numbers.Primes
{-
https://projecteuler.net/problem=12