Skip to content

Instantly share code, notes, and snippets.

View hernanvicente's full-sized avatar

Hernan Maguina hernanvicente

View GitHub Profile
@hernanvicente
hernanvicente / rails_admin.es.yml
Last active September 12, 2018 13:48 — forked from Knack/rails_admin.es.yml
Spanish (Spain) translation for RailsAdmin
es:
admin:
js:
true: Cierto
false: Falso
is_present: Está presente
is_blank: Está en blanco
date: Fecha ...
between_and_: Entre ... y ...
today: Hoy
@hernanvicente
hernanvicente / convert-UNIX-timestamp.js
Created March 30, 2017 22:19 — forked from kmaida/convert-UNIX-timestamp.js
Convert a UNIX timestamp to user's local time via JavaScript
function convertTimestamp(timestamp) {
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds
yyyy = d.getFullYear(),
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0.
dd = ('0' + d.getDate()).slice(-2), // Add leading 0.
hh = d.getHours(),
h = hh,
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0.
ampm = 'AM',
time;
@hernanvicente
hernanvicente / age.rb
Created February 25, 2014 06:34 — forked from emad-elsaid/age.rb
require 'time'
Date_of_birth = '1988-8-31'
# Credit to : http://stackoverflow.com/questions/4136248/how-to-generate-a-human-readable-time-range-using-ruby-on-rails
# and modified a little bit
def humanize secs
[
[60, :seconds],
[60, :minutes],