Skip to content

Instantly share code, notes, and snippets.

View cgarciagl's full-sized avatar
🎮
👍🐱‍👤👋

Carlos García Trujillo cgarciagl

🎮
👍🐱‍👤👋
View GitHub Profile
@cgarciagl
cgarciagl / fechasEnMariaDB.sql
Created June 13, 2024 19:14
Manejo de fechas en MariaDB
#MySQL 5.7.12
#please drop objects you've created at the end of the script
#or check for their existance before creating
#'\\' is a delimiter
#select version() as 'mysql version'
-- Comentarios de una línea
DROP TABLE IF EXISTS Fechas;
@cgarciagl
cgarciagl / juegodelavida.js
Created May 20, 2024 19:11
El juego de la vida en P5js
let resolution = 10;
let grid;
function setup() {
createCanvas(800, 800);
grid = new Grid(width / resolution, height / resolution, resolution);
grid.initialize();
}
function draw() {
@cgarciagl
cgarciagl / fireworks.pde
Last active November 7, 2018 22:30 — forked from kou1okada/fireworks.pde
Fireworks for Processing
/**
* Fireworks for Processing
* Copyright (c) 2018 Koichi OKADA. All rights reserved;
* This code is distributed under the MIT license.
*/
/**
* Modified by cgarciagl for Processing 3 compatibility
*/
@cgarciagl
cgarciagl / get_instance.php
Created December 10, 2013 23:48
code for include the Codeigniter instance into libraries
<?php
public function __get($attr) {
if (isset(get_instance()->$attr)) {
return get_instance()->$attr;
}
}
@cgarciagl
cgarciagl / redirect_by_post.js
Last active August 3, 2024 22:53
function to redirect a webpage to another using post method
function redirectByPost(url, parameters, inNewTab) {
parameters = parameters || {};
inNewTab = inNewTab === undefined ? true : inNewTab;
var form = document.createElement("form");
form.id = "reg-form";
form.name = "reg-form";
form.action = url;
form.method = "post";
form.enctype = "multipart/form-data";
var
C: TChi_square_distribution;
P: Single;
begin
// Creamos la instancia
// en este caso con 4 grados de libertad
C := TChi_square_distribution.create(4);
// Obtenemos la probabilidad acumulada al valor 5
P := C.prob_between(0, 5);
// Probabilidad X >= 5