Skip to content

Instantly share code, notes, and snippets.

View fervisa's full-sized avatar

Fernando Villalobos fervisa

  • Oaxaca, México
View GitHub Profile
@fervisa
fervisa / vimrc
Created September 16, 2014 19:16
Configuración de vim para carpeta específica
colorscheme molokai " Setear esquema de colores
autocmd VimEnter * :NERDTree " Abrir NERDTree al arrancar
@fervisa
fervisa / redis-server
Last active August 29, 2015 14:07 — forked from cyx/gist:3690597
Monit configuration for Redis
check process redis-server
with pidfile "/var/run/redis.pid"
start program = "/etc/init.d/redis-server start"
stop program = "/etc/init.d/redis-server stop"
if 2 restarts within 3 cycles then timeout
if totalmem > 100 Mb then alert
if children > 255 for 5 cycles then stop
if cpu usage > 95% for 3 cycles then restart
if failed host 127.0.0.1 port 6379 then restart
if 5 restarts within 5 cycles then timeout
@fervisa
fervisa / Gruntfile.js
Created April 19, 2015 15:30
Gruntfile to process Angular/Ionic sass, coffee, haml files into css, js, html
/* Gruntfile.js
* Grunt workflow for building AngularJS/Ionic applications.
*/
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
coffee: {
compile: {
@fervisa
fervisa / hash_rocket.vim
Last active August 29, 2015 14:24 — forked from apux/vim_regex.md
:%s/:\(\w\+\) =>/\1:/g
@fervisa
fervisa / mysql_install
Created August 4, 2015 15:00
MySQL installation commands for Arch based systems
mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/
mysql_secure_installation
systemctl enable mysqld
@fervisa
fervisa / column_type.rb
Created August 21, 2015 14:47
Get column type from an ActiveRecord model
@model.column_for_attribute('title').type
@fervisa
fervisa / bundle_install.sh
Created October 19, 2015 23:54
Navigates into every directory and install all required gems
for d in ./*/ ; do (cd "$d" && gem install bundler && bundle install); done
@fervisa
fervisa / search_delete.vim
Last active December 15, 2015 00:00
VIM: Delete all lines matching the search term
:g/search_term/d
@fervisa
fervisa / recognize_path.rb
Created February 1, 2016 20:02
Rails: Recognize route based on path
Rails.application.routes.recognize_path "/accounts/1"
@fervisa
fervisa / tmux-cheatsheet.markdown
Created June 24, 2016 20:03 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname