Skip to content

Instantly share code, notes, and snippets.

let mapleader = " "
" :actionlist for all commands
set surround
set multiple-cursors
set history=1000
set visualbell
set noerrorbells
set incsearch " Highlight search results when typing
set hlsearch " Highlight search results
set relativenumber " relative numbers
object Cached {
def create[F[_]: Concurrent, A](fa: F[A], ttl: FiniteDuration)(implicit t: Timer[F]): F[Cached[F, A]] = {
sealed trait State
case class Value(v: A, ts: Long) extends State
case class Updating(d: Deferred[F, Either[Throwable, A]]) extends State
case object NoValue extends State
def currentTimestamp = t.clock.monotonic(ttl.unit)
Ref.of[F, State](NoValue).map { state =>
new Cached[F, A] {
@punkdata
punkdata / pm_install.sh
Created November 3, 2017 16:36
Postman Install Ubuntu 17.10
#!/usr/bash
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@thomasdarimont
thomasdarimont / readme.md
Last active March 15, 2024 08:56
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | openssl enc -d -base64
@leosuncin
leosuncin / README.md
Last active October 12, 2023 18:00
Install Powerline on Debian/Ubuntu
  1. Install pip sudo apt-get install python-pip or wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py
  2. Install powerline sudo pip install powerline-status
  3. Download and install fonts git clone https://github.com/powerline/fonts.git && cd fonts && sh ./install.sh
  4. Add this lines to respective file
    .vimrc

set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
> " Always show statusline

@staltz
staltz / introrx.md
Last active April 29, 2024 09:25
The introduction to Reactive Programming you've been missing