Skip to content

Instantly share code, notes, and snippets.

View danirod's full-sized avatar
🎯
I may be slow to respond.

Dani Rodríguez danirod

🎯
I may be slow to respond.
View GitHub Profile
@danirod
danirod / Sistema de bloqueo de componentes de terceros.php
Created September 7, 2012 17:30
Código fuente del sistema de bloqueo de componentes de terceros usado en mi web
<?php
/*
* Sistema de bloqueo de componentes de terceros
* Copyright (C) 2012 Dani Rodríguez <danirod@outlook.com>
*
* Este código fuente proporciona de manera pública TAL CUAL, sin garantías de
* ningún tipo. Este código fuente queda en dominio público. Se permite el
* acceso, uso y reutilización de este código fuente en otros sistemas sin
* necesidad de permiso previo ni de notificación de uso.
@danirod
danirod / Sample HTML Code.html
Created September 11, 2012 18:10
Some sample HTML code I found on the Internet. I don't know which page did I took this from, but as I often need this snippet, maybe it's a good idea to save it somewhere.
<!-- Sample Content to Plugin to Template -->
<p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>
<hr />
<h1 id="headings">Headings</h1>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
@danirod
danirod / slick2d_sesion02.java
Created November 10, 2012 19:40
Código fuente visto en el episodio correspondiente de Slick2D
/*
* Este código fuente acompaña al episodio
* Desarrollando un juego en Slick2D - 2. Instalando y programando.
* La dirección del vídeo es http://www.youtube.com/watch?v=qSx4hp47dag.
* Para material adicional, visita http://tutos.danirod.tk/qSx4hp47dag.
*
* © 2012 Dani Rodríguez <danirod@outlook.com>
* Se permite el uso y la distribución de este código fuente de forma
* total o parcial siempre que se mantenga y se indique la autoría
* original del código fuente y que se incluya este mensaje de
package danirod.snippet.test.slick2d.rrtest;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.geom.Rectangle;
import org.newdawn.slick.geom.RoundedRectangle;
import org.newdawn.slick.geom.Shape;
@danirod
danirod / gdbk_helloworld.c
Created August 17, 2013 16:50
Jugando un poco con el GBDK. No me hago responsable de lo que puedas hacer con esto. Necesitas tener instalado el GDBK (Game Boy Developer Kit) - http://gdbk.sourceforge.net
// Jugando un poco con el GBDK.
// Autor: Dani Rodríguez [t:@danirod93]
// No me hago responsable de lo que puedas hacer con esto.
// Necesitas tener instalado el GDBK (Game Boy Developer Kit)
// http://gdbk.sourceforge.net
#include <gb/gb.h>
#include <rand.h>
#include <stdio.h>
@danirod
danirod / hello_sdl.cpp
Created September 7, 2013 17:28
Código fuente de muestra usado en el episodio 02 de la serie Desarrollo de juegos con SDL2.
#include <SDL2/SDL.h>
int main(int argc, char** argv)
{
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Quit();
return 0;
}
@danirod
danirod / struct_static.c
Created September 21, 2013 21:54
ejemplo structs memoria estática
#include <stdio.h>
#include <stdlib.h>
/* Estructura de un producto */
typedef struct {
int codigo_producto; /* código del producto */
char descripcion[20]; /* descripción del producto */
float precio_unitario; /* precio del producto sin IVA */
} t_producto;
@danirod
danirod / imagen.h
Created September 24, 2013 22:07
imagen.h
#ifndef _IMAGEN_H_
#define _IMAGEN_H_
#include <SDL2/SDL.h>
class Imagen
{
public:
Imagen(SDL_Renderer* renderer, const char* ruta);
~Imagen();
@danirod
danirod / btoff.sh
Created November 1, 2013 13:04
Fast way to turn off Bluetooth in HP Pavilion dm1 notebooks equiped with Broadcom wireless cards. These cards have a bug that deactivates WiFi when the user turns off Bluetooth. The only way to turn off Bluetooth without turning off WiFi is using rfkill. This script does all the stuff automatically. Install: just copy this file to /usr/local/bin…
#!/bin/sh
HCI_ID=$(rfkill list | grep hci0 | cut -f1 -d':')
if [ $HCI_ID -ge 0 ]; then
rfkill block $HCI_ID
fi
@danirod
danirod / ministerioscript.py
Last active December 29, 2015 19:28
MinisterioScript. Fuck yea.
def ascii_a_ministerioscript(texto):
convertido = ''
letras = { '00' : 's', '01' : 'd', '10' : 'f', '11' : 'g' }
for caracter in str(texto): # para cada caracter...
binario = bin(ord(caracter))[2:].zfill(8) # lo convertimos a binario.
for i in range(4):
# recorremos el numero binario en grupos de 2 caracteres
subparte = binario[2*i:2*i+2]
# y para cada parte obtenemos la letra que se esconde tras el par
letra = letras[subparte]