Skip to content

Instantly share code, notes, and snippets.

View marceloperini's full-sized avatar
๐Ÿšฉ

Marcelo Perini Veloso marceloperini

๐Ÿšฉ
View GitHub Profile
@marceloperini
marceloperini / alias_matchers.md
Created September 14, 2022 14: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
@marceloperini
marceloperini / move_files_to_main_folder.sh
Created February 18, 2021 18:29
Move all files from subfolders to current folder
find . -mindepth 2 -type f -print -exec mv {} . \;
sudo apt-get install -y \
git \
g++ \
libgtk-3-dev \
gtk-doc-tools \
gnutls-bin \
valac \
intltool \
libtool \
libpcre2-dev \
@marceloperini
marceloperini / 50-marblemouse.conf
Created May 24, 2020 21:23 — forked from pivaldi/50-marblemouse.conf
Xorg Logitech Marble Trackball Config on Debian
# put this file under /usr/share/X11/xorg.conf.d/50-marblemouse.conf
# Large button left : normal click
# Both large buttons : middle click
# Large button right : right-click
# Small button left : browser back
# Small button left+ball : scroll (verticaly or horizontally)
# Small button right : browser forward
@marceloperini
marceloperini / rails-jsonb-queries
Created August 5, 2019 14:53 — forked from mankind/rails-jsonb-queries
Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
class ModelA < ActiveRecord::Base
has_many :other_models, as: origin
has_many :model_bs, -> { where(origin_type: 'ModelA') }, foreign_key: :origin_id
has_many :model_cs, -> { where(origin_type: 'ModelC') }, foreign_key: :origin_id
accepts_nested_attributes :model_bs, :model_cs
end
class ModelB < ActivrRecord::Base
@marceloperini
marceloperini / gist:34a358ab59e87bcb73afbc70282a3bfb
Created October 27, 2017 12:50 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@marceloperini
marceloperini / digital_ocean_setup.md
Created June 24, 2017 15:47 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions
@marceloperini
marceloperini / arch-linux-install
Created March 30, 2017 11:54 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@marceloperini
marceloperini / Efficient Encrypted UEFI-Booting Arch Installation
Created March 21, 2017 16:49 — forked from HardenedArray/Efficient Encrypted UEFI-Booting Arch Installation
An effcient method to install Arch Linux with encrypted root and swap filesystems and boot from UEFI. Multi-OS UEFI-booting is also supported.
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI.
# Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system.
# The official Arch installation guide contains details that you should refer to during this installation process.
# That guide resides at: https://wiki.archlinux.org/index.php/Installation_Guide
# Download the archlinux-*.iso image from https://www.archlinux.org/download/ and its GnuPG signature.
# Use gpg --verify to ensure your archlinux-*.iso is exactly what the Arch developers intended. For example: