Skip to content

Instantly share code, notes, and snippets.

View dysinger's full-sized avatar
😅
16 hour days is OK. Right?

Dysinger dysinger

😅
16 hour days is OK. Right?
  • Independent
  • Nearby
View GitHub Profile
@dysinger
dysinger / example.purs
Created October 17, 2014 21:32
using camelCase for mapping from JSON with Purescript
{-
Author | Tim Dysinger <tim@dysinger.net>
Copyright | WTFPL 2.0 http://www.gnu.org/licenses/license-list.html#WTFPL
-}
module Main where
import Control.Monad.Eff
import Data.Array
@dysinger
dysinger / config.fish
Last active November 8, 2017 08:11
Fish Nix Profile Script
if status --is-login
if [ -n $HOME ]
# NIX PROFILE
set -l NIX_LINK $HOME/.nix-profile
if [ ! -l $NIX_LINK ]
set -l _NIX_DEF_LINK /nix/var/nix/profiles/default
$_NIX_DEF_LINK/bin/ln -s $_NIX_DEF_LINK $NIX_LINK
end
@dysinger
dysinger / install_halvm.sh
Created August 10, 2014 00:11
Install HaLVM
sudo yum update -y
sudo yum groupinstall -y "Development Tools"
sudo yum install -y SDL bridge-utils grub2-tools libaio libuuid-devel ocaml-runtime python-lxml qemu-img wget yajl
wget -r -np --continue http://uhsure.com/halvm-xen-rpms/20/
sudo rpm -i `find uhsure.com -name '*.rpm'`
@dysinger
dysinger / gist:dd22e5c9af12d9ef5d0f
Last active August 29, 2015 14:03
The Modern 4th Amendment

The right of the people to be secure in their persons, houses, electronics, communications, papers, and effects [a] against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.[2]

@dysinger
dysinger / gist:3831c8bd5f581650c65c
Created June 6, 2014 23:55
test kitchen / vagrant TTY error
tim@ip-192-168-0-191:~/src/k/tools/chef-repo/cookbooks/kcb_skel% kitchen converge
-----> Starting Kitchen (v1.2.1)
-----> Creating <default-ubuntu-1204>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of vagrant up --no-provision --provider=virtualbox ----
STDOUT:
STDERR: Vagrant failed to initialize at a very early stage:
@dysinger
dysinger / gist:b820a06a26cc42a304a6
Created June 3, 2014 00:16
One of these things is not like the other.
-- Currying in Haskell
add :: Int -> Int -> Int -> Int -> Int
add a b c d = a + b + c + d
-- use `add 3 7 9 11`
// Currying in Swift
func add(a: Int) -> (Int -> Int) {
func add1(b: Int) -> (Int -> Int) {
func add2(c: Int) -> (Int -> Int) {
func add3(d: Int) -> Int {
@dysinger
dysinger / ec2-vnc-xfce.md
Last active April 15, 2017 18:14
Simple X desktop over VNC for headless servers at EC2

Server Install

Ubuntu

sudo apt-get update
sudo apt-get install -y xfce-session tightvncserver

Client Install

Mac (Comes with OS X)

@dysinger
dysinger / idris-ubuntu-12.04.md
Last active August 29, 2015 13:56
Install Idris (latest) on Ubuntu 12.04

Install GHC & Cabal-Install

apt-get update
apt-get install -y zlib1g-dev libncurses5-dev ghc cabal-install happy alex

Update Cabal-Install

cabal update
cabal install cabal-install

export PATH=$HOME/.cabal/bin:./.cabal-sandbox/bin:$PATH

@dysinger
dysinger / haskell-to-js.log
Created March 2, 2014 21:51
Reeses Haskell Node.js Cups
➤ cat Main.hs
main :: IO ()
main = putStrLn "hello"
➤ hastec --start=asap --opt-all Main.hs
Compiling Main into .
Linking Main.js
Linking Main
Linking GHC.IO.Handle.Text
Linking Haste.Handle
Linking GHC.Tuple
@dysinger
dysinger / Main.idr
Last active August 29, 2015 13:56
Some Errors with the Idris JS Codegen? Am I doing it wrong?
module Main
data Cloud : Type where
AWS : Ptr -> Cloud
data Service : Type where
S3 : Ptr -> Service
amazonCloud : IO Cloud
amazonCloud = mkForeign (FFun "require('aws-sdk');" [] FPtr) >>= return . AWS