Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Come on 2021!

Javier Hernán Caballero García caballerojavier13

🚀
Come on 2021!
View GitHub Profile
View Main.java
import java.util.concurrent.Semaphore;
import java.util.concurrent.ThreadLocalRandom;
public class Main {
static Semaphore resource_1 = new Semaphore(1);
static Semaphore resource_2 = new Semaphore(1);
static Semaphore resource_3 = new Semaphore(1);
static class Proceso extends Thread {
char c = ' ';
View script_2.py
import numpy as np
from MathParser import PyMathParser
# Inicializamos el analizador de funciones
mathparser = PyMathParser()
mathparser.addDefaultFunctions()
mathparser.addDefaultVariables()
# Datos de entrada
View validate_isRU.js
function validate_isRUT(rut)
{
if (rut.length != 12){
return false;
}
if (!/^([0-9])*$/.test(rut)){
return false;
}
var dc = rut.substr(11, 1);
var rut = rut.substr(0, 11);
View insittution.json
{
"general_info": {
"name": "Barbacoa Carrasco",
"legal_name": "Arcadian Corporation LLC",
"address": "523 Avenue Street, New York",
"telephone": "(432) 421 693 812",
},
"colors": {
"primary": {
"bg": "#F44336",
View minimum-quadratic-apporximation-discreet.py
import numpy as np
x = [1.00, 1.20, 1.40, 1.60, 1.80]
y = [0.242, 0.1942, 0.1497, 0.1109, 0.079]
f1 = [0, 0.1823216, 0.3364722, 0.4700036, 0.5877867]
f2 = [0.3678794, 0.3011942, 0.246597, 0.2018965, 0.1652989]
# Resolvemos juntos alguno producto escalares:
n = len(x)
View simon_dice.js
const net = require ('net');
const ip = "192.168.1.52";
const port = 5000;
const client = new net.Socket();
let currentUser = null;
const Gpio = require('onoff').Gpio;
const led_1 = new Gpio(17, 'out');
const led_2 = new Gpio(27, 'out');
@caballerojavier13
caballerojavier13 / generate-pushid.js
Created May 28, 2020 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
View generate-pushid.js
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
View Notas Python - Final Informatica
Flask run => ejecutar programada de python como servidor Flask
(app.py)
python init_database.py => ejecuta el programade cargar la base.
"Levantar el servidor" => Ejecutar el app.py. Escuchar solicitudes del nagador y devolver html.
Un servidor web => Programa que devuelve archivos .html
View Environment_Setup.md

Environment Setup

For Mac

  1. Install brew - (https://brew.sh/)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
View printer.py
from escposprinter import *
from usb.core import find
def getAllPrinters():
for i in find(find_all=True):
print(i)
def printInvoiceFooter():
You can’t perform that action at this time.