Skip to content

Instantly share code, notes, and snippets.

View ander94lakx's full-sized avatar
💻
Hacking stuff

Ander ander94lakx

💻
Hacking stuff
View GitHub Profile
@ander94lakx
ander94lakx / TestMySQL.cpp
Created February 27, 2016 00:23
A C++ Test to check MySQL/MariaDB installation
#include <iostream>
#include <string>
#include <mysql.h>
using namespace std;
class Proc
{
const char* MY_HOSTNAME;
const char* MY_DATABASE;

Apuntes de Git

Git es un SCV (Sistema de Control de Versiones) distribuido. Fue pensado para el desarrollo de Linux, y actualmente es el SCV más usado.

Uso básico

Init

Para crear un repositorio (en una carpeta vacia) hay que ejecutar el comando git init

#include <SDL2/SDL.h>
#include <stdint.h>
// Definimos la funcion "callback" (para usarla en el main())
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// Variables par aindicar en que posicion esta y la lognitud de el audio QUE SE ESTA REPRODUCIENDO
static Uint8 *audio_pos; // Posicion
static Uint32 audio_len; // Longitud
#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h> // Esta vez incluimos el SDL_mixer.h, que hara que todo sea mas facil
// OJO: para ello hay que instalar los paquetes
// libsdl2-mixer-2.0-0
// libsdl2-mixer-dev
// Instalar en Ubuntu: sudo apt-get install libsdl2-mixer-2.0-0 libsdl2-mixer-dev
#include <stdio.h>
#include <stdbool.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h> // Esta vez incluimos el SDL_mixer.h, que hara que todo sea mas facil
// OJO: para ello hay que instalar los paquetes
// libsdl2-mixer-2.0-0
// libsdl2-mixer-dev
// Instalar en Ubuntu: sudo apt-get install libsdl2-mixer-2.0-0 libsdl2-mixer-dev
@ander94lakx
ander94lakx / funtzioak.c
Last active June 15, 2017 18:16
Pianoa grabatzen/erreproduzitzen
/*
* funtzioak.c
*
* Created on: 30 may. 2017
* Author: alex
*/
#include <string.h>
#include <time.h>
#include <unistd.h>
@ander94lakx
ander94lakx / funtzioak.c
Last active September 4, 2017 09:20
PruebasSDL2
#include "Funtzioak.h"
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
void inicializar()
{
double pi = 3.1415926535;
int NumGrado = rand() % 360;
TTF_Font* Sans = TTF_OpenFont("Sans.ttf", 24); //this opens a font style and sets a size
SDL_Color White = {255, 255, 255}; // this is the color in rgb format, maxing out all would give you the color white, and it will be your text's color
SDL_Surface* surfaceMessage = TTF_RenderText_Solid(Sans, "put your text here", White); // as TTF_RenderText_Solid could only be used on SDL_Surface then you have to create the surface first
SDL_Texture* Message = SDL_CreateTextureFromSurface(renderer, surfaceMessage); //now you can convert it into a texture
SDL_Rect Message_rect; //create a rect
Message_rect.x = 0; //controls the rect's x coordinate
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
void bistaratuAlderantziz(char *str);
int main()
{
char hitza[15];
@ander94lakx
ander94lakx / DatabaseTest.py
Created October 9, 2018 06:48
A simple database load test with tables with random values
import mysql.connector
import random
import sys
import time
import threading
DB_host="localhost"
DB_port="3307"
DB_user="root"