Skip to content

Instantly share code, notes, and snippets.

View gavocanov's full-sized avatar

Paolo Gavocanov gavocanov

  • Infobip
  • Pula, Croatia
View GitHub Profile
@i-am-tom
i-am-tom / FizzBuzz.hs
Last active June 26, 2023 16:35
Arguably the fastest implementation of FizzBuzz ever written.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE UnsaturatedTypeFamilies #-}
import GHC.TypeLits
import Prelude hiding (Functor, Semigroup)
type Main = (Fizz <> Buzz) <$> (0 `To` 100)
@ekmett
ekmett / CEK.hs
Created July 22, 2018 17:53
A more strongly typed CEK machine
{-# Language StrictData #-}
{-# Language GADTs #-}
{-# Language DeriveTraversable #-}
{-# Language LambdaCase #-}
module CEK where
import Control.Monad (ap)
import Data.Maybe
import Data.Void
@ekmett
ekmett / CEK.hs
Created July 22, 2018 17:52
Simple CEK Machine
{-# language StrictData #-}
module CEK where
-- C -- Control
-- E -- Environment
-- (S) -- Store
-- K -- Continuation
data Exp
= Var String
@tom-seddon
tom-seddon / ido-goto-symbol.el
Last active June 30, 2018 10:38
ido/imenu mashup.
;; Interactively invoke ido-goto-symbol in a buffer that imenu understands.
(defun tom/get-imenu-alist ()
;; clean up old imenu data -- bit cheeky
(require 'imenu)
(imenu--menubar-select imenu--rescan-item)
(imenu--make-index-alist)
(let ((name-and-pos '()))
(cl-labels ((addsymbols (symbol-list)
(when (listp symbol-list)
@tom-seddon
tom-seddon / find-definition-of-elisp-symbol.el
Last active June 30, 2018 10:38
DWIM find-function kind of affair.
;; Interactively invoke tom/find-definition-of-elisp-symbol with point on an elisp symbol.
(defvar tom/find-definition-of-elisp-symbol-history '())
(defvar tom/find-definition-of-elisp-symbol-old-marker nil)
(defun tom/find-definition-of-elisp-symbol-add-marker ()
(when tom/find-definition-of-elisp-symbol-old-marker
(ring-insert find-tag-marker-ring tom/find-definition-of-elisp-symbol-old-marker)
(setq tom/find-definition-of-elisp-symbol-old-marker nil)))
@alexandrnikitin
alexandrnikitin / install-systemtap-on-centos-7.sh
Created August 11, 2017 14:06
Install systemtap on Centos 7
sudo yum install -y systemtap systemtap-runtime
sudo yum install kernel-debuginfo kernel-debuginfo-common
sudo yum install yum-utils
debuginfo-install kernel-3.10.0-514.21.2.el7.x86_64
sudo yum install -y kernel-devel-$(uname -r)
sudo yum install -y kernel-debuginfo-$(uname -r)
sudo yum install -y kernel-debuginfo-common-$(uname -m)-$(uname -r)
@kepbod
kepbod / iterm2-italics.sh
Last active October 1, 2023 13:28
use italics in iterm2
{ infocmp -1 xterm-256color ; echo "\tsitm=\\E[3m,\n\tritm=\\E[23m,"; } > /tmp/xterm-256color.terminfo
tic /tmp/xterm-256color.terminfo
" Add this to your vimrc to get a minimalist autocomplete pop
" Or use as a plugin : https://github.com/maxboisvert/vim-simple-complete
" Minimalist-TabComplete-Plugin
inoremap <expr> <Tab> TabComplete()
fun! TabComplete()
if getline('.')[col('.') - 2] =~ '\K' || pumvisible()
return "\<C-P>"
else
@adeekshith
adeekshith / .git-commit-template.txt
Last active February 21, 2024 12:06 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@michaelmrose
michaelmrose / Example.md
Last active October 12, 2018 23:42
A Colored Clojure Repl Via Neovim, Fish, and Lein

A Colored Clojure Repl Via Neovim, Fish, and Lein

We'll start with the assumption that your cwd in vim is set to the directory of a clojure file perhaps via autochdir.

Now with some vimscript we'll start a terminal buffer, set the proper syntax coloring, turn on rainbow parens and only then run lein repl. Note it doesn't work if these aren't done before lein repl.

function! NvimRepl()
 terminal