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 / 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 / hash_rocket.vim
Last active August 29, 2015 14:24 — forked from apux/vim_regex.md
:%s/:\(\w\+\) =>/\1:/g
@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 / 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 / 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 / vimrc
Created September 16, 2014 19:14
Configuración vim por directorio
set exrc " habilita archivos .vimrc por directorio
set secure " deshabilita comandos inseguros en archivos .vimrc locales
@fervisa
fervisa / related-filter.coffee
Created July 13, 2014 15:13
Custom filter to format id based on catalogue
@fervisa
fervisa / angular-turbolinks.coffee
Created July 13, 2014 14:33
Angular.js: Turbolinks compatibility
@fervisa
fervisa / angular-csrf-token.coffee
Created July 13, 2014 14:32
Handling Rails csrf-token from an Angular app
demoApp.config ($httpProvider) ->
authToken = $("meta[name=\"csrf-token\"]").attr("content")
$httpProvider.defaults.headers.common["X-CSRF-TOKEN"] = authToken
@fervisa
fervisa / spec_helper.js.coffee
Created July 13, 2014 14:27
specs init for angular backend mocking
#= require application
#= require angular-mocks
#= require support/sinon
#= require support/jasmine-sinon
beforeEach(module('demoApp'))
beforeEach inject (_$httpBackend_, _$compile_, $rootScope, $controller, $location, $injector, $timeout) ->
@scope = $rootScope.$new()
@http = _$httpBackend_