Skip to content

Instantly share code, notes, and snippets.

View josejuansanchez's full-sized avatar

José Juan Sánchez josejuansanchez

View GitHub Profile
PROVINCIA(#id, nombre)
LOCALIDAD(#id, nombre, id_provincia)
id_provincia: FK de PROVINCIA
CLIENTE(#id, nombre, apellido1, apellido2, dirección, código_postal, teléfono, id_localidad)
id_localidad: FK de PROVINCIA
TIENDA(#id, dirección, código_postal, id_localidad)
id_localidad: FK de LOCALIDAD
DROP DATABASE IF EXISTS agencia_viajes;
CREATE DATABASE agencia_viajes CHARACTER SET utf8;
USE agencia_viajes;
CREATE TABLE agencia (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
direccion VARCHAR(128) NOT NULL,
telefono VARCHAR(9) NOT NULL
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@josejuansanchez
josejuansanchez / howto-tft-recalbox.md
Last active August 2, 2023 13:23
Cómo configurar un TFT-LCD de 3.5 pulgadas para RPi 3 y Recalbox
@josejuansanchez
josejuansanchez / mBlock.md
Created March 26, 2017 20:49
Notas sobre la extensión de NanoPlayBoard para mBlock
@josejuansanchez
josejuansanchez / sratch_workshop.md
Last active March 11, 2017 15:43
Scratch Workshop - 11/03/2017

Bienvenidos a Scratch 2.0

¿Qué es Scratch?

Scratch es un entorno de programación amigable basado en bloques que nos permite crear proyectos digitales.

Creado por el MIT Media Lab Lifelong Kindergarten Group.

¿Cómo puedo usar Scratch?

@josejuansanchez
josejuansanchez / check_reception.ino
Created March 10, 2017 13:12
Sketchs para comprobar la conectividad del módulo Bluetooth
#include <SoftwareSerial.h>
SoftwareSerial softSerial(10, 11);
void setup() {
softSerial.begin(9600);
Serial.begin(9600);
softSerial.println("Setup!");
Serial.println("Setup!");
}
@josejuansanchez
josejuansanchez / snake.pde
Last active December 23, 2016 12:30
Snake. Processing Game. Raspberry Hackers, 23 December, 2016.
// This is the first game developed by the Raspberry Hackers team.
// 23 December, 2016. Las Norias (Almería).
// Reference: https://www.youtube.com/watch?v=JGW5ecDOjjk
int w;
int h;
int bs = 20;
ArrayList<Integer> x = new ArrayList<Integer>();
ArrayList<Integer> y = new ArrayList<Integer>();
@josejuansanchez
josejuansanchez / latency.markdown
Created October 12, 2016 16:52 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@josejuansanchez
josejuansanchez / ActivityA.java
Created July 24, 2016 21:37
Stackoverflow answer, "Singleton in Android"
package com.example.testSingleton;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;
public class ActivityA extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {