Skip to content

Instantly share code, notes, and snippets.

View vitprado's full-sized avatar

Vitor Prado vitprado

View GitHub Profile
@nitrix
nitrix / gahello.php
Last active November 23, 2021 12:21
Hello World! Testing Genetic Algorithms in PHP
<?php
$POPULATION = array(); //population of individuals
$POPULATION_SIZE = 100;
$DNA_SIZE = 12;
$GEN_COUNT = 1;
$TEST_COUNT = 0;
genInitPopulation();
while (true) {
naturalSelection();
@jonatw
jonatw / install_opencv_debian.sh
Last active September 1, 2016 04:58
install opencv on debian, tested on raspberry pi (debian wheezy)it takes "long time" for compiling opencv library. please be patient.Reference: http://opencv.willowgarage.com/wiki/InstallGuide_Linux
#install esseintal packages for opencv
apt-get -y install build-essential
apt-get -y install cmake
apt-get -y install pkg-config
apt-get -y install libgtk2.0-dev libgtk2.0
apt-get -y install zlib1g-dev
apt-get -y install libpng-dev
apt-get -y install libjpeg-dev
apt-get -y install libtiff-dev
apt-get -y install libjasper-dev
@mdonkers
mdonkers / server.py
Last active June 25, 2024 18:48
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@arjunv
arjunv / keyevents.json
Created December 2, 2018 00:01
All Android Key Events for usage with adb shell
{
"key_events": {
"key_unknown": "adb shell input keyevent 0",
"key_soft_left": "adb shell input keyevent 1",
"key_soft_right": "adb shell input keyevent 2",
"key_home": "adb shell input keyevent 3",
"key_back": "adb shell input keyevent 4",
"key_call": "adb shell input keyevent 5",
"key_endcall": "adb shell input keyevent 6",
"key_0": "adb shell input keyevent 7",
@vitprado
vitprado / gahello.php
Last active July 15, 2022 19:53 — forked from nitrix/gahello.php
Genetic Algorithms in PHP
<?php
$POPULATION = array(); //population of individuals
$GEN_COUNT = 1;
$TEST_COUNT = 0;
$GENE_OPTIONS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ !@#$%&*1234567890";
if( isset($_GET['goal']) ){
$GOAL = $_GET['goal'];
} else {
$GOAL = "Hello World!";