Skip to content

Instantly share code, notes, and snippets.

@mariomachuca
mariomachuca / Botones.ino
Created April 14, 2017 03:34
Codigo Botones Arduino
/* Tutorial 2
* Presionamos un boton para encender un LED,
* lo volvemos a presionar para apagarlo
*/
int estado=0; //Guarda estado del botón
int estadoAnterior=0; //Guardar el estado anterior del botón
int salida=0; //0= Led Apagado / 1=Led Encendido
void setup() {
@mariomachuca
mariomachuca / _form.html.erb
Last active December 9, 2016 07:10
CRUD del Articulo
<% art_name ||= @article.title %>
<h1><%= name %> Artículo <%= art_name %></h1>
<%=simple_form_for @article, html: {multipart: true} do |f| %>
<% @article.errors.full_messages.each do |message|%>
<div class="be-red white top-space">
* <%= message %>
</div>
<% end %>
<div class="field">
@mariomachuca
mariomachuca / _form.html.erb
Last active July 28, 2016 19:13
nested forms venta producto
<h1><%= name %> Venta </h1>
<div class="well">
<%= simple_form_for @vent do |f| %>
<%= f.input :empleado_id, as: :hidden, input_html: {value: current_empleado.id}%>
<%=f.input :fecha, { :discard_day => true, :discard_month => true, :discard_year => true } %>
<%= f.simple_fields_for :productos_vents do |p| %>
<div>
<%= render 'producto', :f=>p %>
</div>