Skip to content

Instantly share code, notes, and snippets.

View pedrogk's full-sized avatar

Pedro Galvan pedrogk

View GitHub Profile
@pedrogk
pedrogk / cycles.py
Created April 28, 2024 20:21
icp_ver
573808652
@pedrogk
pedrogk / spacecanvas.html
Created March 4, 2014 18:28
Código en html y javascript para hacer un canvas con una imagen de fondo con estrellas y una nave espacial que se mueve al detectar un evento touch.
<!DOCTYPE html>
<html>
<head>
<title>Space Canvas</title>
</head>
<body>
<h1>Juego de nave espacial con Canvas</h1>
<canvas id="spaceCanvas" width="300" height="300">
</canvas>
</body>
@pedrogk
pedrogk / main.py
Created December 20, 2022 19:17
Propositos año nuevo
import random
propositos = [
"Terminar los cursos a los que me inscribo",
"Dejar de hacer deploy en viernes",
"Poner mejores comentarios en mis commits",
"Tenerle más paciencia al Scrum Master",
"No olvidar el 'Where' en el 'Delete'",
"Lograr que mi crush sepa que es mi crush",
"No involucrarme en discusiones inútiles en Twitter",
@pedrogk
pedrogk / pozole.js
Last active September 12, 2022 21:02
Receta pozole para mensaje en redes
let carne = "surtida de puerco"
if (cuidandoLinea)
carne = "pollo"
fetch("olla con agua")
.then( () => agregar(["maiz pozolero", "ajo", "sal"]) )
.then( () => hervir({ minutos: 60 }))
.then( () => agregar([carne, "salsa preparada"]))
.then( () => hervir({ minutos: 90 }))
@pedrogk
pedrogk / cuadrado.prolog
Created November 17, 2015 05:00
Prolog code for finding magic squares 3x3
/* condiciones iniciales */
numero(1).
numero(2).
numero(3).
numero(4).
numero(5).
numero(6).
numero(7).
numero(8).
numero(9).
@pedrogk
pedrogk / estudio-salarios-sg.ipynb
Created March 26, 2021 17:30
Estudio Salarios SG.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pedrogk
pedrogk / view_stats.py
Last active June 4, 2019 22:47
View in the BP2C Reviews app (Django) to display descriptive statistics for the different answers in the survey for a company
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from django.contrib.auth import get_user
from django.db.models import Max, Avg, Count
from .models import ReviewInstance, Criteria,Contact
from .choices import CATEGORIES
@pedrogk
pedrogk / powerplug-toggle.js
Created August 20, 2018 18:11
Toggle con PowerPlug
<Toggle initial={false}>
{({ on, toggle }) => <Checkbox onClick={toggle} checked={on} />}
</Toggle>
@pedrogk
pedrogk / toggle.js
Created August 20, 2018 18:09
Toggle normal
class Toggle extends Component {
state = {
on: false
}
toggle = () => {
this.setState(() => {
on: !this.state.on
})
}
render() {
@pedrogk
pedrogk / button.js
Created August 20, 2018 18:08
Ejemplo de styled component
const Button = styled.button`
border-radius: 3px;
padding: 0.25em 1em;
margin: 0 1em;
background: transparent;
color: red;
border: 2px solid red;
`;