Skip to content

Instantly share code, notes, and snippets.

View jesuslerma's full-sized avatar

jesuslerma

  • globalgig
  • Monterrey Mexico
View GitHub Profile
// aqui defino las variables que me pasaste
function calcData () {
poblationInit = 122823652 // 122´823, 652
newHabitantMx = 25.6
newBirthMx = 14.5
deathMexican = 44.15
dayInit = '01/01/2017'
today = new Date()
todayMom = moment(today) // aqui uso la variable today para traer la hora/fecha actual
document.getElementById("btnAgrupar").onclick = enviar;
function enviar()
{
var token = '';
var arrayOfIds = [];
var allInputs = document.getElementsByTagName("input");
for (var i = 0, max = allInputs.length; i < max; i++)
ropa = Category.create name: 'Ropa'
electro = Category.create name: 'Electronicos'
disco = Category.create name: 'Discos'
Product.create name: 'Playera Locochona', photo: 'https://pbs.twimg.com/profile_images/561116211258220544/FlICmGnj.jpeg', stock: 12, category_id: ropa.id
Product.create name: 'Playera Locochona', photo: 'https://pbs.twimg.com/profile_images/561116211258220544/FlICmGnj.jpeg', stock: 12, category_id: ropa.id
@jesuslerma
jesuslerma / templateList.html
Last active July 31, 2017 05:22
Sample Vue.s
<template id='productsTemplate'>
<ul>
<li v-for="product in products">
{{product.name}} {{product.color}} cuesta ${{product.price}}
</li>
</ul>
</template>
@jesuslerma
jesuslerma / docker_ruby.sh
Created July 17, 2020 13:18
Simple notes on how to run ruby in containers
# This is for running an irb
docker run --it --rm ruby:2.5
# This is for running an script
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp ruby:2.5 ruby hello_world.rb
# this is the content we should put in hello_world.rb Make sure to add the first line
# #!/usr/bin/env Ruby
# puts Hello World from Dockerfile
# we also need to make the script executable
chmod u+x hello_world.rb