Skip to content

Instantly share code, notes, and snippets.

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@t0mab
t0mab / action_controller_review.md
Created October 23, 2024 10:00 — forked from jamesyang124/action_controller_review.md
Notes for action controller overview from Rails official site. rails 4.2
@t0mab
t0mab / pylance_patcher.rs
Created April 30, 2024 08:04 — forked from pickx/pylance_patcher.rs
Patch Pylance's VSCode check
#!/usr/bin/env -S cargo +nightly -Zscript --quiet
---
[package]
edition = "2021"
[dependencies]
eyre = "0.6.12"
home = "0.5.9"
---
@t0mab
t0mab / jq-cheetsheet.md
Created March 30, 2022 10:19 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@t0mab
t0mab / Efficient Encrypted UEFI-Booting Arch Installation
Created April 26, 2019 20:22 — 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, and VirtualBox, UEFI-booting are also supported.
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI.
# Note this encrypted installation method, while perfectly correct and highly secure, CANNOT support encrypted /boot and
# also CANNOT be subsequently converted to support an encrypted /boot!!! A CLEAN INSTALL will be required!
# Therefore, if you want to have an encrypted /boot or will want an encrypted /boot system at some point in the future,
# please ONLY follow my encrypted /boot installation guide, which lives here:
@t0mab
t0mab / memoize.py
Created July 3, 2018 09:37 — forked from martync/memoize.py
Memoize Django model's method.
import functools
def memoize_django_model_method(obj):
@functools.wraps(obj)
def memoizer(*args, **kwargs):
# Get the model instance
instance = args[0]
@t0mab
t0mab / rofi-emoji.sh
Created February 24, 2018 00:55 — forked from tadly/rofi-emoji.sh
Rofi emoji picker
#!/usr/bin/env bash
#
# Use rofi to pick emoji because that's what this
# century is about apparently...
#
# Requirements:
# rofi, xsel, curl, xmllint
#
# Usage:
# 1. Download all emoji
@t0mab
t0mab / Pure CSS search input.markdown
Created July 3, 2017 21:57
Pure CSS search input
@t0mab
t0mab / VagrantFile.rb
Created June 9, 2017 00:10 — forked from marktheunissen/VagrantFile.rb
Running Ansible on a Vagrant machine without a plugin
Vagrant::Config.run do |config|
config.vm.define :default do |tw_config|
tw_config.vm.box = "precise64"
tw_config.vm.box_url = "http://files.vagrantup.com/precise64.box"
tw_config.vm.provision :shell, :path => "provision/ansible-setup.sh"
tw_config.vm.provision :shell, :path => "provision/controller-setup.sh"
# Load a local setup file if it exists, so you can use it to
# provide additional provisioning steps.