Skip to content

Instantly share code, notes, and snippets.

View adetokunbo's full-sized avatar

Timothy Emiola adetokunbo

  • Itoshima, Japan
View GitHub Profile
@adetokunbo
adetokunbo / keybase.md
Last active February 7, 2018 02:15
Keybase proof

Keybase proof

I hereby claim:

  • I am adetokunbo on github.
  • I am tbetbetbe (https://keybase.io/tbetbetbe) on keybase.
  • I have a public key ASDFJwG7GPPX9h1kepDRx_dlhWRx6ZfswDjuhCY-n3-PdAo

To claim this, I am signing this object:

;; -*- 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 / .spacemacs
Last active February 26, 2021 00:14
.spacemacs enabling dante mode/nix/cabal in spacemacs main branch
;;; ...
;;; ...
;; List of additional packages that will be installed without being
;; wrapped in a layer. If you need some configuration for these
;; packages, then consider creating a layer. You can also put the
;; configuration in `dotspacemacs/user-config'.
;; Cabal/Nix haskell setup
dotspacemacs-additional-packages '(dante nix-sandbox)
@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 / SyncJSONAndText.hs
Created March 19, 2018 11:29
Haskell snippet: ToJSON a => a -> Text,FromJSON a => Text -> Maybe a
import Data.Text (Text)
import Data.Text.Lazy (fromStrict, toStrict)
import Data.Text.Lazy.Builder (toLazyText)
import Data.Text.Lazy.Encoding (encodeUtf8)
import Data.Aeson
import Data.Aeson.Text (encodeToTextBuilder)
asText :: ToJSON a => a -> Text
@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.