Skip to content

Instantly share code, notes, and snippets.

View leopolicastro's full-sized avatar

Leo Policastro leopolicastro

View GitHub Profile
" Plugins {{{
call plug#begin()
Plug 'itchyny/lightline.vim'
Plug 'jessarcher/vim-heritage'
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'kana/vim-textobj-user'
Plug 'nelstrom/vim-textobj-rubyblock'
Plug 'pangloss/vim-javascript'
"" Download vim-plug if missing
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
call plug#begin('~/.vim/plugged')
Plug 'Eliot00/git-lens.vim'
Plug 'airblade/vim-gitgutter'
"" Download vim-plug if missing
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
call plug#begin('~/.vim/plugged')
Plug 'Eliot00/git-lens.vim'
Plug 'airblade/vim-gitgutter'
" Fisa-vim-config
" http://fisadev.github.io/fisa-vim-config/
" version: 8.3.1
" ============================================================================
" Vim-plug initialization
" Avoid modify this section, unless you are very sure of what you are doing
let vim_plug_just_installed = 0
rails new my_project -T -d postgresql \
-m https://gist.githubusercontent.com/\
leopolicastro/ac4bf77ecfdb755c114d0f63e25112eb/\
raw/a4ba4366402fb8a8b5e3b9880f05ff26888e8c65/template.rb
gem_group :development, :test do
gem 'rspec-rails'
gem 'factory_bot_rails'
gem 'capybara'
gem 'webdrivers'
gem 'faker'
end
initializer 'generators.rb', <<-CODE
Rails.application.config.generators do |g|
@leopolicastro
leopolicastro / snake.rb
Created September 4, 2022 13:04
Ruby Snake
require "ruby2d"
set background: "navy"
set fps_cap: 20
GRID_SIZE = 20 # grid size is 20 pixels
# for window that is 480 * 640, width is 32 (640/20) and height is 24 (480/20) at grid size = 20 pixels
GRID_WIDTH = Window.width / GRID_SIZE
GRID_HEIGHT = Window.height / GRID_SIZE
# Blur the image using ImageMagick
MiniMagick::Image.new tempfile.path do |image|
image.blur "0x16"
end
logger.info "Image #{file_name} was blurred"
git submodule update --recursive --remote