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 / Create-branch-with-Github-API.md
Created August 28, 2018 10:22 — forked from Potherca/README.md
Create a branch on Github without access to a local git repo using http://hurl.eu/

Ever had the need to create a branch in a repo on Github without wanting (or being able) to access a local repo?

With the aid of [the Github API][1] and [hurl.eu][2] this is a piece of cake!

Just follow these steps:

  1. Open [http://hurl.eu/][2]
  2. Find the revision you want to branch from. Either on Github itself or by doing a GET request from Hurl: https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs/heads
  3. Copy the revision hash
  4. Do a POST request from Hurl to https://api.github.com/repos///git/refs with the following as the POST body :
@adetokunbo
adetokunbo / prismatic.hs
Created February 13, 2019 03:09 — forked from parsonsmatt/prismatic.hs
I figured out a nice way to pluck exceptions out of a constraint!
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
@adetokunbo
adetokunbo / the-algebra-of-algebraic-data-types.md
Created May 12, 2019 12:32 — forked from gregberns/the-algebra-of-algebraic-data-types.md
The Algebra of Algebraic Data Types, Part 1, by Chris Taylor
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
{-# LANGUAGE OverloadedStrings #-}
module SimpleThings where
import Control.Applicative ((<$>), (<*>))
import Control.Monad (mzero)
import Data.Aeson
import qualified Data.Aeson as A
-- | sum type containing all possible payloads
-- Example of a dynamically generated FromJSON instance.
--
-- Can be useful when one needs to use a function with a
-- FromJSON constraint, but some detail about the
-- conversion from JSON is not known until runtime.
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
module HFilter where
data a :* b = a :* b
deriving (Show, Eq)
infixr 5 :*
hlist :: Int :* String :* Int :* Maybe Float :* ()
@adetokunbo
adetokunbo / haskell.yml
Created September 30, 2021 08:16 — forked from mstksg/haskell.yml
Stack Project Github Action Template
# Haskell stack project Github Actions template
# https://gist.github.com/mstksg/11f753d891cee5980326a8ea8c865233
#
# To use, mainly change the list in 'plans' and modify 'include' for
# any OS package manager deps.
#
# Currently not working for cabal-install >= 3
#
# Based on https://raw.githubusercontent.com/commercialhaskell/stack/stable/doc/travis-complex.yml
#
@adetokunbo
adetokunbo / setup-ubuntu-wp.sh
Created December 3, 2021 19:36 — forked from tjstein/setup-ubuntu-wp.sh
WordPress auto-setup for Ubuntu (ve)
#!/bin/bash
cd
#
# fix locales
#
echo "en_US.UTF-8 UTF-8" > /var/lib/locales/supported.d/local
dpkg-reconfigure locales
{
"AD": {
"countryName": "Andorra",
"currency": "EUR",
"symbol": "€"
},
"AE": {
"countryName": "United Arab Emirates",
"currency": "AED",
"symbol": "AED"