Skip to content

Instantly share code, notes, and snippets.

View Cerr0s's full-sized avatar

Luis Cerritos Cerr0s

  • Guadalajara, Jalisco, México
View GitHub Profile
@Cerr0s
Cerr0s / AFD.c
Created February 28, 2012 06:05
Simulador de un Automata Finito Determinista, generado por FLEX.
#line 3 "lex.yy.c"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 35
@Cerr0s
Cerr0s / AFD.l
Created February 28, 2012 06:04
Simulador de un Automata Finito Determinista
%{ /∗ programa en f l e x para s imu lar un DFA ∗/
%}
%x B C
%%
<INITIAL>0 { yymore ( ) ; BEGIN(B) ; }
<INITIAL>1 { yymore ( ) ; BEGIN(C) ; }
<INITIAL>\n { printf ( " No estás en un estado final\n " ) ; exit ( 1 ) ; }
<INITIAL>[^01] { printf ( " Sólo ceros y unos!\ n " ) ; exit ( 1 ) ; }
<B>0 { yymore ( ) ; BEGIN(C) ; }
<B>1 { yymore ( ) ; BEGIN(B) ; }
@Cerr0s
Cerr0s / mds5gen.sh
Created February 21, 2011 23:58
Generates MD5 Keys in Bash using Perl MD5::Digest Library.
#!/bin/bash
# Variables para el Mes y el Año
export Month=$(LANG=es_MX.utf8 date --d now +%B)
export Year=$(LANG=es_MX.utf8 date --d now +%Y)
export Unit=$(cat /security/keys/Unit)
perl -MDigest::MD5 -e 'print Digest::MD5::md5_hex($ENV{Month}._.$ENV{Year}._Unidad_.$ENV{Unit});'
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.*;
import java.util.ArrayList;
public class Nodo {
double x, y;
private Point2D Origen;
Rectangle2D Cuadro;
@Cerr0s
Cerr0s / DBConn.php
Created January 6, 2010 11:21
Connect to mySQL from PHP (Testing Gist)
/* Benemerita Universidad Autonoma de Puebla
* Facultad de Ciencias de la Computación
*
* Luis Angel Cerritos Ortiz
* cerros.mach@gmail.com
* Clase Pedorra que Conecta a mySQL desde PHP */
<?php
class DB_MySQL {