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

#!/bin/bash
# For easily getting themes from: https://github.com/storm119/Tilix-Themes/blob/master/Themes.md
# This data was generated by running the following in the console on the above page:
#
# Javascript, chrome console:
#
# codes = document.getElementsByTagName("code")
# var builder = ""
# for (i = 0; i < codes.length; i++) {
# the svn plugin has to be activated for this to work.
_fishy_collapsed_wd() {
echo $(pwd | perl -pe '
BEGIN {
binmode STDIN, ":encoding(UTF-8)";
binmode STDOUT, ":encoding(UTF-8)";
}; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g
')
}
@NeMO84
NeMO84 / config
Last active June 8, 2018 04:02
i3wm config file
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
" yank to clipboard
if has("clipboard")
set clipboard=unnamed " copy to the system clipboard
if has("unnamedplus") " X11 support
set clipboard+=unnamedplus
endif
endif
" Select your Leader key
let mapleader = "\<Space>"
#!/bin/bash
# Usage: vb-reset-host-version-guestproperty.sh myvmname
VMNAME=$1
VBOXMANAGE="$(which vboxmanage)"
if [ -z "$VMNAME" ]; then
echo "Must provide name of VM."
exit 1
#!/bin/bash
# http://stackoverflow.com/questions/85880/determine-if-a-function-exists-in-bash
function_exists() {
declare -f -F $1 > /dev/null
return $?
}
# function_exists function_name && echo Exists || echo No such function
@NeMO84
NeMO84 / update-coreos-cloud-config.sh
Created December 7, 2015 08:21 — forked from maxcnunes/update-coreos-cloud-config.sh
Update coreos cloud config
#!/bin/bash
SERVER_IP=<MY_SERVER_IP>
# copy cloud-config.yml to the server
scp cloud-config.yml core@$SERVER_IP:~/
# validate cloud-config file
ssh core@$SERVER_IP "coreos-cloudinit -validate --from-file ~/cloud-config.yml"
if [[ $? == "0" ]]; then
@NeMO84
NeMO84 / .gemrc
Last active November 23, 2015 20:39 — forked from jch/.gemrc
Base .gemrc file example.
# http://guides.rubygems.org/command-reference/#gem-environment
---
gem: --no-document
benchmark: false
verbose: true
update_sources: true
sources:
- https://rubygems.org
backtrace: true
bulk_threshold: 1000
InfluxSrv:
image: "tutum/influxdb:0.8.8"
ports:
- "8083:8083"
- "8086:8086"
expose:
- "8090"
- "8099"
environment:
- PRE_CREATE_DB=cadvisor