Skip to content

Instantly share code, notes, and snippets.


Sameer Kolhar kolharsam

View GitHub Profile
chiroptical / babyShark.hs
Last active Mar 4, 2022
Baby shark as a Haskell program
View babyShark.hs
{-# LANGUAGE BlockArguments #-}
module Main where
main :: IO ()
main = do
do do do do do do babyShark
do do do do do do babyShark
do do do do do do babyShark
serras /
Created Dec 15, 2020
Advent of Haskell 2020

Talking about Toys

Every year Santa 🎅 brings joy (and presents 🎁) to all the kids in the world. Well, not when I was a child! Following the usual Spanish traditions, the Three Reyes Magos brought me presents in their camels 🐫 following the Star 💫 Nowadays, it's Sinterklaas who puts pepernoten in my shoes 👞. Because in fact there's not one, but a group of present-bringing people, distributed across the globe 🌐, each with their own part of the world to cover (or you really thought just one man and eight reindeers could do it all by their own?)

In order to communicate, they need a way to exchange information about presents. Since they are all very wise, they've agreed to use Haskell, so this information is represented using algebraic data types. Here are some types related to building blocks:

data Block = Block BlockBrand String Color
data BlockBrand = LegoKNex
GavinRay97 / docker-compose.yaml
Created Aug 27, 2020
Hasura GraphQL Tx over Websockets client
View docker-compose.yaml
version: '3.6'
image: postgres:12
restart: always
- db_data:/var/lib/postgresql/data
POSTGRES_PASSWORD: postgrespassword
iansu /
Last active Mar 1, 2021
Create React App 4.0 Alpha Testing

Create New App

JavaScript Template

npx create-react-app@next --scripts-version=@next --template=cra-template@next my-js-app

TypeScript Template

npx create-react-app@next --scripts-version=@next --template=typescript@next my-ts-app

View org-capture-demo.el
;;; org-capture-demo.el --- Org capture demo configuration.
;;; Commentary:
;;; Author: Suvrat Apte
;;; Created on: 03 May 2020
;;; Copyright (c) 2019 Suvrat Apte <>
;; This file is not part of GNU Emacs.
;;; License:
View maxPointsOnLine.hs
*Main> maxPointsOnLine [(1,1), (3,2), (5,3), (4,1), (2,3), (1,4)]
lispyclouds / monads.clj
Last active May 17, 2020
Monads, simple made easier
View monads.clj
; A simple demo of monadic composition of side effects
; Program to take 3 nubers as input and print their sum.
(defn read-and-add!
(print "Enter a number: ")
(+ prev (do (flush)
(Integer/parseInt (read-line)))))
(defn bind
borkdude / js_parser.clj
Last active Jun 30, 2020
Parse JavaScript in Clojure using the Google Closure Compiler
View js_parser.clj
"exec" "clojure" "-Sdeps" "{:deps {org.clojure/clojurescript {:mvn/version \"1.10.520\"}}}" "$0" "$@"
;; running js_parser.clj "function foo(x) { var y = x + 1; }" will print:
;; [{:type :function, :name "foo", :body [{:variable-statement [{:lvalue "y", :initializer {:type :binary-op, :left "x", :operator "+", :right "1"}}]}], :params ["x"]}]
dino- / string-conversions.hs
Last active Aug 18, 2022
A handy illustration of converting between String, Text and ByteString in Haskell
View string-conversions.hs
#! /usr/bin/env stack
-- stack --resolver lts-18.8 script
{-# LANGUAGE OverloadedStrings #-}
This is a handy illustration of converting between five of the commonly-used
string types in Haskell (String, ByteString, lazy ByteString, Text and lazy
vedang / psk.clj
Last active May 11, 2020
A Clojure simulation of the Passport Seva Kendra
View psk.clj
(ns challenges.psk
"A Simulation of the Passport Seva Kendra"
(:require [clj-time.core :as ct]
[ :as ctl])
(:import [java.util.concurrent LinkedBlockingQueue PriorityBlockingQueue]))
(def working-hours? (atom false)) ; use this to control agents.
; Turning this off will
; shutdown agents.