Skip to content

Instantly share code, notes, and snippets.

View matiasleidemer's full-sized avatar

Matias H. Leidemer matiasleidemer

View GitHub Profile
// TypeScript-specific way to ensure that other objects with the same shape
// can’t be interpreted as this type
declare const NsType: unique symbol
declare const LbfsType: unique symbol
// Ns effectively just wraps a value of type number.
class Ns {
readonly value: number;
[NsType]: void
@matiasleidemer
matiasleidemer / alias_matchers.md
Created January 8, 2019 19:15 — forked from JunichiIto/alias_matchers.md
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
# Ring the bell if any background window rang a bell
set -g bell-action any
# set -g utf8
# set-window-option -g utf8 on
set -g status on
# set -g status-utf8 on
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal "screen-256color"
set nocompatible " be iMproved, required
set number " shows line numbers
"set relativenumber " show relative line numbers
set hlsearch " highlight search results
set cursorline " highlight cursor line
set laststatus=2 " this is needed for airline
set visualbell " no sounds
set colorcolumn=80 " column with 80
set wildmode=list " expand and folders/tabs when opening a file
set backspace=2 " makes backspace work as it should work
@matiasleidemer
matiasleidemer / paginate.rb
Last active January 8, 2018 14:34 — forked from be9/paginate.rb
kaminari + JSON API pagination helper
def paginate(scope, default_per_page = 20)
collection = scope.page(params[:page]).per((params[:per_page] || default_per_page).to_i)
current, total, per_page = collection.current_page, collection.total_pages, collection.limit_value
render json: [{
pagination: {
current: current,
previous: (current > 1 ? (current - 1) : nil),
next: (current == total ? nil : (current + 1)),
# Ring the bell if any background window rang a bell
set -g bell-action any
# set -g utf8
# set-window-option -g utf8 on
set -g status on
# set -g status-utf8 on
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal "screen-256color"
require 'deterministic'
module ParamDecorator
module_function
extend Deterministic::Prelude::Result
# alias :>> :map
# alias :m :method # method returns a proc for a method
set nocompatible " be iMproved, required
set number " shows line numbers
set relativenumber " show relative line numbers
set hlsearch " highlight search results
set cursorline " highlight cursor line
set laststatus=2 " this is needed for airline
set visualbell " no sounds
set colorcolumn=80 " column with 80
set wildmode=list " expand and folders/tabs when opening a file
set backspace=2 " makes backspace work as it should work
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
# Ring the bell if any background window rang a bell
set -g bell-action any
set -g utf8
set-window-option -g utf8 on
set -g status on
set -g status-utf8 on
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal "screen-256color"