Skip to content

Instantly share code, notes, and snippets.

View adetokunbo's full-sized avatar

Timothy Emiola adetokunbo

  • Itoshima, Japan
View GitHub Profile
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@adetokunbo
adetokunbo / Run.hs
Created March 16, 2018 02:31 — forked from dalaing/Run.hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module Run (
runner
) where
import Control.Monad.Reader (ReaderT, runReaderT)
import Data.Foldable (traverse_)
@adetokunbo
adetokunbo / .ghci
Created March 16, 2018 02:31 — forked from 3noch/.ghci
Reflex-DOM Auto Reload Development with ghcid
:set prompt "> "
:set -isrc
:load Main
@adetokunbo
adetokunbo / LocalStorage.hs
Created March 17, 2018 09:18 — forked from blargg/LocalStorage.hs
Using javascript function with Reflex and JSaddle
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExtendedDefaultRules #-}
import Reflex.Dom
import Control.Monad.IO.Class
import Control.Monad (void)
import Data.Text (Text)
import Language.Javascript.JSaddle
import Control.Lens ((^.))
main :: IO ()
@adetokunbo
adetokunbo / Main.hs
Created March 20, 2018 05:50 — forked from mightybyte/Main.hs
Attaching reflex to a particular node
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
------------------------------------------------------------------------------
import Control.Concurrent
import Control.Monad
import Control.Monad.Trans
@adetokunbo
adetokunbo / autotools.nix
Created March 22, 2018 06:19 — forked from lucabrunox/autotools.nix
Nix pill 10
pkgs: attrs:
with pkgs;
let defaultAttrs = {
builder = "${bash}/bin/bash";
args = [ ./builder.sh ];
setup = ./setup.sh;
baseInputs = [ gnutar gzip gnumake gcc binutils coreutils gawk gnused gnugrep patchelf findutils ];
buildInputs = [];
system = builtins.currentSystem;
};
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TemplateHaskell #-}
-- | Demo:
-- | 1) config and state (model) accessible everywhere without pushing
-- parameters around in a reflex app.
-- | 2) Pushing more than one event to 'EventWriter' and using
-- 'coincidence' to extract them.
@adetokunbo
adetokunbo / configure.sh
Last active June 22, 2018 00:24 — forked from LnL7/configure.sh
darwin nix-daemon distributed builds
#!/usr/bin/env bash
sudo mkdir -p /nix/run/nix/current-load
sudo launchctl unload /Library/LaunchDaemons/org.nixos.nix-daemon.plist
sudo rm /Library/LaunchDaemons/org.nixos.nix-daemon.plist
sudo curl -fsSL -o /Library/LaunchDaemons/org.nixos.nix-daemon.plist https://gist.githubusercontent.com/adetokunbo/bd4d36d147445168d1eb186d73765a59/raw/249be6a9c44b7804ca960ec364cc393477422315/org.nixos.nix-daemon.plist
sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist
# Configure /etc/nix/machines
# Make sure root can ssh to the builder (known_hosts etc.)
@adetokunbo
adetokunbo / redirect.hs
Created June 26, 2018 04:07 — forked from alpmestan/redirect.hs
servant redirects, new generation
{-
$ curl -X POST localhost:9876/dog -v
* Connected to localhost (127.0.0.1) port 9876 (#0)
> POST /dog HTTP/1.1
> Host: localhost:9876
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Transfer-Encoding: chunked
#!/usr/bin/env nix-shell
#!nix-shell -i runhaskell -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [servant-server servant-generic servant-auth-server lens resource-pool sqlite-simple string-conv interpolatedstring-perl6 ])"
#!nix-shell -I /home/ielectric/dev
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE LambdaCase #-}