Skip to content

Instantly share code, notes, and snippets.

View luisdfonseca's full-sized avatar

Luis Daniel Fonseca luisdfonseca

View GitHub Profile
@luisdfonseca
luisdfonseca / install-parallel-centos-7.sh
Last active April 28, 2022 09:48 — forked from mkubenka/install-parallel-centos-6.sh
Install GNU Parallel on CentOS 7 and CentOS8
#!/bin/bash
# Install GNU parallel on CentOS 7 and CentOS8 .
# http://software.opensuse.org//download.html?project=home%3Atange&package=parallel
cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/home:/tange/CentOS_7/home:tange.repo
yum install parallel
# Alternative:

Rails Generating & Scaffolding

Rails' use of strict naming conventions means a lot of core code SHOULD be in the same format whoever writes it? It could be written by a friend, colleague or a computer... it shouldn't matter because the same Rails rules apply to everyone.

This means that Rails can actually do some tasks for you! It can actually build things and write code on your behalf...

Coming from another language like PHP, this can seem like magic.

@luisdfonseca
luisdfonseca / .bashrc
Last active October 19, 2020 18:17
A basic .bashrc configuration
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@luisdfonseca
luisdfonseca / .vimrc
Last active October 18, 2020 23:27 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@luisdfonseca
luisdfonseca / .zshrc
Last active October 18, 2020 23:26
basic .zshrc file
# Load version control information
autoload -Uz vcs_info
precmd() { vcs_info }
# Format the vcs_info_msg_0_ variable
zstyle ':vcs_info:git:*' formats 'on branch %b'
# Set up the prompt (with git branch name)
setopt PROMPT_SUBST
PROMPT='%n in ${PWD/#$HOME/~} ${vcs_info_msg_0_} > '
export CLICOLOR=1
@luisdfonseca
luisdfonseca / rvm-to-rbenv.md
Last active October 18, 2020 02:03 — forked from akdetrick/rvm-to-rbenv.md
Guide to switching to rbenv bliss from RVM hell

RVM to rbenv

Why? @sstephenson explains it best here.


1) remove RVM from your system

This should get rid of the rvm dir and any installed rubies:

$ rvm implode
@luisdfonseca
luisdfonseca / screenshot.rb
Last active October 9, 2019 07:25
Take a screenshot from chrome using ruby
require 'selenium-webdriver'
width = 1024
height = 728
driver = Selenium::WebDriver.for :chrome
driver.navigate.to 'http://google.com'
driver.manage.window.resize_to(width, height)
driver.save_screenshot('screenshot.png')