Skip to content

Instantly share code, notes, and snippets.

View salverde's full-sized avatar

salomonic salverde

View GitHub Profile
@salverde
salverde / friendly_urls.markdown
Created March 14, 2017 06:45 — forked from jcasimir/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@salverde
salverde / GNUPG Cheatsheet.md
Created April 8, 2017 08:34 — forked from turingbirds/GNUPG Cheatsheet.md
GPG (GNUPG) Cheatsheet

GNUPG CHEATSHEET

Setting up: key generation

This generates a public/private keypair.

$ gpg --gen-key

$ gpg --list-secret-keys

@salverde
salverde / ruby_readline_issue.md
Created June 18, 2017 00:24 — forked from soultech67/ruby_readline_issue.md
ruby bundler: Sorry, you can't use byebug without Readline

Preamble

On OS/X Sierra, after recently running a brew update I started receiving the error message Sorry, you can't use byebug without Readline when trying to run some rake tasks in my ruby project folder. I observed this in projects and gems that include byebug or pry in their Gemfile or gem.spec. I've found in my googling that many begin encountering this error message after running a brew update but there are other triggering conditions as well.

>> rake aws:show_config
WARN: Unresolved specs during Gem::Specification.reset:
      mime-types (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
 Sorry, you can't use byebug without Readline. To solve this, you need to
@salverde
salverde / deploy_rails_app.rb
Created July 7, 2017 14:18 — forked from saroar/deploy_rails_app.rb
Centos 7, NginX, Puma, Mina
# Deploy
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv'
set :rails_env, 'production'
set :deploy_to, 'deploy_location_without_current'
set :app_path, 'app_location'
set :user, 'alif'
@salverde
salverde / Sublime Text License Key
Last active September 15, 2017 05:10 — forked from abriemme/Sublime Text License Key
Sublime License Info
crack Sublime Text (2 and 3)
1. Open Sublime in a HEX editor (the executable file)
2. Find 43 33 33 42 30 32
3. Replace in the string 33 42 with 32 42
4. Save
5. Enter the license below:
—–BEGIN LICENSE—–
Patrick Carey
@salverde
salverde / Build_Vim8.0_RHEL2.6.md
Last active October 19, 2017 00:08 — forked from junxie6/Build_Vim7.4_CentOS7.txt
Compile the latest Vim 8.0 on RHEL2.6.x

Compile the Vim 8.0 on RHEL 2.6.x

$ yum install gcc make ncurses ncurses-devel
$ yum install ruby ruby-devel lua lua-devel luajit \
  luajit-devel ctags git python python-devel \
  python3 python3-devel tcl-devel \
  perl perl-devel perl-ExtUtils-ParseXS \
  perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \
  perl-ExtUtils-Embed
$ yum clean all
@salverde
salverde / check_docker_container.sh
Created November 21, 2017 08:07 — forked from ekristen/check_docker_container.sh
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
@salverde
salverde / InstallingAgOnCentOS.md
Created December 1, 2017 00:02 — forked from rkaneko/InstallingAgOnCentOS.md
Installing ag: the silver searcher on CentOS.

Installing ag on CentOS

Prerequistes

  • libpcre
  • liblzma

Download, build and install

@salverde
salverde / tmux-cheatsheet.markdown
Created August 4, 2018 00:58 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@salverde
salverde / .tigrc
Created November 26, 2018 12:56 — forked from spicycode/.tigrc
my tigrc
# vim: set expandtab sw=4 tabstop=4:
# *color* 'area' 'fgcolor' 'bgcolor' '[attributes]'
# general
color default 15 235
color cursor 15 241
color title-focus 242 221
color title-blur 242 221
color delimiter 213 default
color author 156 default