Skip to content

Instantly share code, notes, and snippets.

View rderoldan1's full-sized avatar
🇨🇴

Ruben Espinosa rderoldan1

🇨🇴
  • Medellin, Colombia
View GitHub Profile
@rderoldan1
rderoldan1 / migration.rb
Created August 5, 2013 06:32
Rails number db format
t.integer :int # int (4 bytes, max 2,147,483,647)
t.integer :int1, :limit => 1 # tinyint (1 byte, -128 to 127)
t.integer :int2, :limit => 2 # smallint (2 bytes, max 32,767)
t.integer :int3, :limit => 3 # mediumint (3 bytes, max 8,388,607)
t.integer :int4, :limit => 4 # int (4 bytes)
t.integer :int5, :limit => 5 # bigint (8 bytes, max 9,223,372,036,854,775,807)
t.integer :int8, :limit => 8 # bigint (8 bytes)
t.integer :int11, :limit => 11 # int (4 bytes)
@rderoldan1
rderoldan1 / rdoc.css
Last active December 22, 2015 01:29
css for rdoc, code syntax like github
/*
* "Darkfish" Rdoc CSS
* $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $
*
* Author: Michael Granger <[email protected]>
* Edited: Ruben Espinosa <[email protected]>
*
*/
/* Base Green is: #6C8C22 */
@rderoldan1
rderoldan1 / desable.coffee
Created September 1, 2013 22:33
Disable all options if readonly class is present
$('select.readonly option:not(:selected)').attr('disabled',true)
@rderoldan1
rderoldan1 / gallery.coffee
Created September 9, 2013 15:28
Simple photo gallery
def export
selected = params[:select_export][:id]
fecha_corte = params[:fecha_corte_tf]
if(%w(2 3 4).include?(selected)) && (fecha_corte.eql? "")) && (fecha_corte.eql? "")
redirect_to :back, :alert => "Seleccione una fecha de corte"
else
respond_to do |format|
format.csv do
@rderoldan1
rderoldan1 / _partial.html.erb
Created September 24, 2013 13:29
PDF Rendering using partials
<h5>Mi partial content</h5>
<%= @object.some_attribute %>
@rderoldan1
rderoldan1 / 0_reuse_code.js
Created November 7, 2013 15:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rderoldan1
rderoldan1 / gist:7363635
Created November 7, 2013 23:24
ejemplo
clase Jugador
edad = 0
goles = 0
nacimiento = 0000-00-00
posicion = ""
valor = 0
inicializador(edad, goles, nacimiento, posicion)
edad = edad
@rderoldan1
rderoldan1 / README.md
Created December 13, 2013 16:03
Ignore file changes in git

Fortunately GIT has a very easy solution for this, just run the following command on the file or path you want to ignore the changes of:

git update-index --assume-unchanged <file>

If you wanna start tracking changes again run the following command:

git update-index --no-assume-unchanged <file>

source: http://blog.pagebakers.nl/2009/01/29/git-ignoring-changes-in-tracked-files/

@rderoldan1
rderoldan1 / formula.java
Last active January 2, 2016 17:19
Cambio en formulas de Reportes Vcenter
/*
* Formula Memoria
*/
row.createCell(8).setCellFormula("(100-I1-G"+(inicial+1)+")%*C"+(inicial +1));
/*
* Formula Procesador
*/
row.createCell(7).setCellFormula("(100-I1-F"+(inicial+1)+")%*B"+(inicial +1));