Skip to content

Instantly share code, notes, and snippets.

View ricsdeol's full-sized avatar

Ricardo Siqueira de Oliveira Leite ricsdeol

View GitHub Profile
Atom Sync
@ricsdeol
ricsdeol / fibonacci.rb
Created September 29, 2015 04:00
Ruby Fibonnacci Memoization
2.1.6 :001 > fib = Hash.new{ |h,k| h[k] = k < 2 ? k : h[k-1]+h[k-2] }
=> {}
2.1.6 :002 > fib[1]
=> 1
2.1.6 :003 > fib[10]
=> 55
2.1.6 :004 > fib
=> {1=>1, 0=>0, 2=>1, 3=>2, 4=>3, 5=>5, 6=>8, 7=>13, 8=>21, 9=>34, 10=>55}
@ricsdeol
ricsdeol / post_install.sh
Last active July 5, 2020 01:27
Post install ubuntu
sudo add-apt-repository ppa:linrunner/tlp
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@ricsdeol
ricsdeol / Gemfile.lock
Last active May 7, 2016 17:07
AMS v9.X with knock
active_model_serializers (0.9.5)
activemodel (>= 3.2)
knock (1.4.2)
bcrypt (~> 3.1)
jwt (~> 1.5)
rails (>= 4.2)
@ricsdeol
ricsdeol / .gemrc
Last active December 4, 2023 20:37
Dotfiles
gem: --no-document
@ricsdeol
ricsdeol / .zshrc
Last active December 4, 2023 20:37
Python version pyenv @ oh-my-zsh theme
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@ricsdeol
ricsdeol / snap_clean.sh
Created June 13, 2018 13:25
Clean disabled snap apps
#!/bin/sh
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
sudo snap remove "$snapname" --revision="$revision"
done
#observation: I copied this script from another person but i don't remember where.
@ricsdeol
ricsdeol / fino-time-asdf.zsh-theme
Created August 11, 2019 15:53
oh-my-zsh fino-time theme adapter to use asdf
# fino-time.zsh-theme
# Use with a dark background and 256-color terminal!
# Meant for people with RVM and git. Tested only on OS X 10.7.
# You can set your computer name in the ~/.box-name file if you want.
# Borrowing shamelessly from these oh-my-zsh themes:
# bira
# robbyrussell
@ricsdeol
ricsdeol / SPLUNK_RECIPES.md
Created May 18, 2020 17:37 — forked from chuckg/SPLUNK_RECIPES.md
Splunk Storm recipes for Heroku logs.

Splunk Recipes for Heroku

A collection of Splunk recipes for Heroku logs. Instructions for setting up Splunk Storm with Heroku can be found here. For the vast majority of these recipes you'll need to have enabled the Heroku labs feature, log-runtime-metrics, for your application.

@ricsdeol
ricsdeol / ruby install.md
Last active December 15, 2021 23:29
Clean Ruby and some databases Environment

Install some dependences

// improve battery perform
sudo add-apt-repository ppa:linrunner/tlp


sudo sh -c 'echo "deb [arch=amd64]  https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -