Skip to content

Instantly share code, notes, and snippets.

View MacoChave's full-sized avatar
👨‍💻
Learning about Api REST

Marco Chávez MacoChave

👨‍💻
Learning about Api REST
View GitHub Profile
@MacoChave
MacoChave / Upload_File.js
Last active October 6, 2021 21:55
Fragments code - React
const [state, setState] = useState()
handleFile(event) {
let file = event.target.files[0]
this.setState({file : file})
}
handleUpload(event) {
let file = this.state.file
let formData = new FormData()
//#define Hall_Sensor A0
#define Hall_Sensor_D 2
int Val2 = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(Hall_Sensor_D, INPUT);
}
@MacoChave
MacoChave / bubbleSort.asm
Last active November 5, 2020 02:05
Sorting asm
bubbleSort PROC
xor bx, bx
xor cx, cx
mov cl, countStats
dec cx
iloop_quickSort:
push cx
push bx
xor ax, ax
@MacoChave
MacoChave / component.html
Last active July 16, 2020 19:13
Condicionales y plantillas en angular
<h1>App Component</h1>
<!-- [atributo] -> Atributo modo solo atributo: Toma valor de variable -->
<!-- (atributo) -> Atributo modo solo evento: Asigna valor a variable -->
<!-- [(atributo)] -> Atributo modo atributo y evento: Toma y Asigna valor a variable -->
<input type="text" [(ngModel)]="name" />
<p>{{ name }}</p>
<ng-container *ngIf="flag; else empty">
<div class="container">
@MacoChave
MacoChave / webToCordova.sh
Last active July 13, 2019 21:47
Generar apk con Cordova
# INSTALAR CORDOVA
sudo npm install -g cordova
# CREAR UNA APP
cordova create MyApp
# DEFINIR UNA PLATAFORMA
cordova platform add ( browser | android )
# COPIAR COMPILADOS DE LA APP WEB
@MacoChave
MacoChave / ficheroManager.c
Last active October 4, 2018 19:15
CREAR - LEER - ACTUALIZAR - ELIMINAR ARCHIVOS BINARIOS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void readFile (char * filename)
{
FILE * file;
/*
ABRIR FILE * EN MODO LECTURA [r]
NULL SI NO EXISTE EL FICHERO
@MacoChave
MacoChave / ListViewAdapter.java
Created September 13, 2018 05:00
File Chooser
package com.macochave.filechooser;
import android.content.Context;
import android.net.Uri;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
@MacoChave
MacoChave / analizer.c
Created August 9, 2018 03:16
Analizador para proyecto de MIA 2s 2018
#ifndef ANALIZER_H
#define ANALIZER_H
#include <stdio.h>
#include "structs/mlist.h"
#include "structs/comando.h"
#include "structs/parametro.h"
#include "commands/cmd_mkdisk.h"
#include "commands/cmd_rmdisk.h"
#include "commands/cmd_fdisk.h"
@MacoChave
MacoChave / CSS
Created June 20, 2018 04:23
Apuntes y guías de diseño web
#BACKGROUND
@MacoChave
MacoChave / binaryToDecimal.cpp
Created June 9, 2018 17:13
Conversión entre bases numéricas
#include <iostream>
#include <math.h>
using namespace std;
/*
* CONVERT BINARY '11011' TO DECIMAL
* |__c__|__r__|__i__|_2^i_|_dec_|
* | 1101| 1 | 0 |__1__|__1__|
* | 110| 1 | 1 |__2__|__2__|