Skip to content

Instantly share code, notes, and snippets.

View gist:aa85f7ad2a34e47c4a09d5dbbd5d43a6

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

View get-Tilix-Themes.sh
#!/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++) {
View nemonster.zsh-theme
# 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 Jun 8, 2018
i3wm config file
View config
# 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!
View neo-init.vim
" 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>"
View vb-reset-host-version-guestproperty.sh
#!/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
View bash_function_exists
#!/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
View update-coreos-cloud-config.sh
#!/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 Nov 23, 2015 — forked from jch/.gemrc
Base .gemrc file example.
View .gemrc
# 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
View monitoring.yml
InfluxSrv:
image: "tutum/influxdb:0.8.8"
ports:
- "8083:8083"
- "8086:8086"
expose:
- "8090"
- "8099"
environment:
- PRE_CREATE_DB=cadvisor