Skip to content

Instantly share code, notes, and snippets.

View kingsleyh's full-sized avatar
😍
Coding

Kingsley Hendrickse kingsleyh

😍
Coding
View GitHub Profile
@kingsleyh
kingsleyh / Watch.d
Created March 28, 2017 13:28
watcher
import std.algorithm;
import std.array;
import std.conv;
import std.exception;
import std.file;
import std.process;
import std.string;
import std.encoding : sanitize;
import std.stdio;
import std.algorithm;
import std.array;
import std.conv;
import std.exception;
import std.file;
import std.process;
import std.string;
import std.encoding : sanitize;
import std.stdio;
module Router where
--http://www.parsonsmatt.org/2015/10/22/purescript_router.html
--https://github.com/parsonsmatt/purescript-routing-example/blob/master/src/Router.purs
--https://github.com/slamdata/slamdata/blob/13a6e619248386a5fd868326a1cf517c0ef124c4/src/SlamData/Prelude.purs#L116
--https://github.com/slamdata/slamdata/blob/13a6e619248386a5fd868326a1cf517c0ef124c4/src/SlamData/Workspace/Component/ChildSlot.purs
import BigPrelude
import Routing (matchesAff)
@kingsleyh
kingsleyh / router.purs
Last active June 21, 2017 17:03
signup
module Router where
--http://www.parsonsmatt.org/2015/10/22/purescript_router.html
--https://github.com/parsonsmatt/purescript-routing-example/blob/master/src/Router.purs
--https://github.com/slamdata/slamdata/blob/13a6e619248386a5fd868326a1cf517c0ef124c4/src/SlamData/Prelude.purs#L116
--https://github.com/slamdata/slamdata/blob/13a6e619248386a5fd868326a1cf517c0ef124c4/src/SlamData/Workspace/Component/ChildSlot.purs
import BigPrelude
import Routing (matchesAff)
@kingsleyh
kingsleyh / SweetAlert.js
Created July 17, 2017 21:05
Halogen wrapping
"use strict";
exports.alert_ = function(callback) {
return function(config) {
return function() {
var title = config.title;
var text = config.text;
var confirmButton = config.confirmButton;
var cancelButton = config.cancelButton;

Keybase proof

I hereby claim:

  • I am kingsleyh on github.
  • I am kingsleyh (https://keybase.io/kingsleyh) on keybase.
  • I have a public key ASBNYT0q1ULj1q-s-WCj9wHYGBaOVUv7hpYW5slDuV9zDwo

To claim this, I am signing this object:

@kingsleyh
kingsleyh / ad
Created August 15, 2017 15:59
ad
AJmQ4KpEVnUyDrpAtKLaXrgYjyHdjdJcMJ
@kingsleyh
kingsleyh / Main.elm
Created November 22, 2017 15:47
Ksenia Number Game in Elm
module Main exposing (..)
import Html exposing (Html, button, div, input, p, program, text)
import Html.Attributes exposing (placeholder, type_)
import Html.Events exposing (onClick, onInput)
-- MODEL
@kingsleyh
kingsleyh / cr1.cr
Last active January 1, 2018 17:38
crystal
def isLoggedIn(context, repo)
sessionId = context.session.string?("userId")
if sessionId
user = repo.findUserByUserId(sessionId)
case user
when DB::Success
groupId = user.value["activeChannel"].as_h.fetch("groupId", "")
channelId = user.value["activeChannel"].as_h.fetch("channelId", "")
@kingsleyh
kingsleyh / g.cr
Created January 2, 2018 16:53
generics
def onParams(context, klass : T, &block) forall T
result = klass.parse(contextToJson(context))
p typeof(result)
if result.is_a?(T)
yield result
else
HTTPCodes.notFound(context, {message: result})
end
end