Skip to content

Instantly share code, notes, and snippets.

@israelb
israelb / ls-analytics.js
Last active May 14, 2016 16:11
life and style
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-1420780-22', 'auto');
ga('send', 'pageview');
</script>
@israelb
israelb / tags con git
Created May 6, 2016 13:32
TAGS con git
# Hacer un tag con un comentario
git tag -a v2.5.0 -m "Cambio de pasos del acreditado, más estable el sistema"
# Subir el tag
git push origin v2.5.0
# listar todos los tag
git tag
@israelb
israelb / new_gist_file.md
Created March 2, 2016 04:15 — forked from wrburgess/new_gist_file.md
Upgrading heroku databases
heroku addons:add heroku-postgresql:standard-0 --remote staging
heroku maintenance:on --remote staging
heroku ps:scale worker=0 --remote staging
heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_PINK --remote staging
heroku pg:promote HEROKU_POSTGRESQL_PINK --remote staging
heroku ps:scale worker=1 --remote staging
heroku maintenance:off --remote staging
@israelb
israelb / rails_helper.rb
Last active May 15, 2017 04:25
helpers rspec
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
#require 'spec_helper'
require 'capybara/rspec'
require 'capybara/rails'
require 'capybara/poltergeist'
@israelb
israelb / 00-100-colours.gif
Created November 30, 2015 17:24 — forked from grough/00-100-colours.gif
Generate animated gif with ruby + rmagick
00-100-colours.gif
This gist is the update of this post https://u.osu.edu/hasnan.1/2014/03/30/rails-4-multiple-file-upload-with-carrierwave-nested-form-and-jquery-file-upload/
License MIT
@israelb
israelb / gist:a00cbeabdd30f830d970
Last active September 17, 2015 19:54 — forked from alisterlf/gist:3490957
JAVASCRIPT:Remove Accents
function RemoveAccents(strAccents) {
var strAccents = strAccents.split('');
var strAccentsOut = new Array();
var strAccentsLen = strAccents.length;
var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
for (var y = 0; y < strAccentsLen; y++) {
if (accents.indexOf(strAccents[y]) != -1) {
strAccentsOut[y] = accentsOut.substr(accents.indexOf(strAccents[y]), 1);
} else
@israelb
israelb / tmux_cheatsheet.markdown
Last active September 8, 2015 14:50 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@israelb
israelb / edit.html.erb
Last active August 29, 2015 14:23
editar cuenta
<div class="authform">
<h3>Editar cuenta</h3>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :role => 'form'}) do |f| %>
<%= devise_error_messages! %>
<div class="form-group">
<%= f.label :firstname %>
<%= f.text_field :firstname, :autofocus => true, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :email %>
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop