Skip to content

Instantly share code, notes, and snippets.

View BernardNotarianni's full-sized avatar
🏠
Working from home

Bernard Notarianni BernardNotarianni

🏠
Working from home
  • Paris, France
View GitHub Profile
@BernardNotarianni
BernardNotarianni / README.md
Last active December 23, 2018 14:39
Haskell Recipes

Haskell recipes

Read and print to console

main :: IO ()
main = do
  putStrLn("Hello! what is your name?")
  name <- getLine
  putStrLn("Hello " ++ name ++ "!")
@BernardNotarianni
BernardNotarianni / Spec.hs
Created April 11, 2018 08:00
premier increment de refactoring
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Test.Hspec
main :: IO ()
main = hspec spec
newtype Montant = Montant Int
deriving (Eq, Ord, Enum, Num)
instance Show Montant where

Keybase proof

I hereby claim:

  • I am bernardnotarianni on github.
  • I am notarianni (https://keybase.io/notarianni) on keybase.
  • I have a public key ASApPPTxeZfWEJkur9nA_AsLr5sUnASAcosFzh0DfqotZAo

To claim this, I am signing this object:

%% Copyright 2016, Bernard Notarianni
%%
%% Licensed under the Apache License, Version 2.0 (the "License"); you may not
%% use this file except in compliance with the License. You may obtain a copy of
%% the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
;;; packages.el --- Erlang Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
@BernardNotarianni
BernardNotarianni / cliptem.sh
Created December 28, 2015 11:31
Create i3 projet layout
#!/usr/bin/env bash
# Load i3 windows layout
i3-msg "workspace 2; append_layout ~/.i3/cliptem.json"
# PDF reader for phoenix book
i3-msg "workspace 2; exec evince"
# Backlog
i3-msg "workspace 2; exec emacsclient -c ~/cliptem/cliptem/todo.org"
@BernardNotarianni
BernardNotarianni / user.el
Created September 21, 2015 19:54
flycheck erlang otp
;; customize flycheck for otp standard directory structure
(require 'flycheck)
(flycheck-define-checker erlang-otp
"An Erlang syntax checker using the Erlang interpreter."
:command ("erlc" "-o" temporary-directory "-Wall"
"-I" "../include" "-I" "../../include"
"-I" "../../../include" source)
:error-patterns
((warning line-start (file-name) ":" line ": Warning:" (message) line-end)
(error line-start (file-name) ":" line ": " (message) line-end)))
@BernardNotarianni
BernardNotarianni / spacemacssheet.tex
Last active August 22, 2017 13:25
Spacemacs Cheat Sheet
\documentclass[10pt,landscape]{article}
\usepackage{multicol}
\usepackage{calc}
\usepackage{ifthen}
\usepackage[landscape]{geometry}
\usepackage{hyperref}
% based on latex cheat sheet https://wch.github.io/latexsheet/
%
% To make this come out properly in landscape mode, do one of the following
@BernardNotarianni
BernardNotarianni / chain.erl
Created June 17, 2015 17:43
Broadcast over process
-module (chain).
-export ([new/1]).
-export ([send/2]).
-export ([stop/1]).
%% Create a chain of N processes
new (N) ->
[spawn (fun () -> child_reply () end) || _ <- lists: seq (1,N)].
%% Send a message to all processes on chain
@BernardNotarianni
BernardNotarianni / vat.hs
Last active August 29, 2015 14:21
carpaccio haskell comment
-- vat processing input from a list
-- maybe more adapted if data would come from an external sources?
vat :: String -> Double
vat c =
case c `lookup` vatRates of
Just x -> x
Nothing -> 0
vatRates:: [(String, Double)]