Skip to content

Instantly share code, notes, and snippets.

View boodahDEV's full-sized avatar
💻
what up? 💻

boodah boodahDEV

💻
what up? 💻
View GitHub Profile
@boodahDEV
boodahDEV / gotoxy_for_windows
Last active September 25, 2020 03:13
Esta función mueve el cursor de la ventana de texto a la posición según las coordenadas especificadas por los argumentos x e y. Si las coordenadas no son válidas entonces la llamada a la función gotoxy es ignorada. Los argumentos no pueden ser 0.
void gotoxy(int x,int y){
HANDLE hcon;
hcon = GetStdHandle(STD_OUTPUT_HANDLE);
COORD dwPos; dwPos.X = x; dwPos.Y= y;
SetConsoleCursorPosition(hcon,dwPos);
}
@boodahDEV
boodahDEV / gotoxy_for_linux.c
Last active September 12, 2023 01:13
Ejemplo básico de uso del gotoxy en C. Funcional en Linux. Sin uso de la librería conio,h. Simplemente para no olvidar su codificación y demás. :D
#include<stdio.h>
//gotoxy() function definition
void gotoxy(int x,int y)
{
printf("%c[%d;%df",0x1B,y,x);
}
int main ()
{
@boodahDEV
boodahDEV / Color scheme to console
Created January 14, 2020 05:22
This scheme is for add color my console while use NodeJS
Below you can find colors reference of text to command when running node.js application:
console.log('\x1b[36m%s\x1b[0m', 'I am cyan'); //cyan
console.log('\x1b[33m%s\x1b[0m', stringToMakeYellow); //yellow
Colors reference
Reset = "\x1b[0m"
Bright = "\x1b[1m"
Dim = "\x1b[2m"
public boolean isEmail(String correo) {
Pattern pat = null;
Matcher mat = null;
pat = Pattern.compile("^([0-9a-zA-Z]([_.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+([a-zA-Z]{2,9}.)+[a-zA-Z]{2,3})$");
mat = pat.matcher(correo);
if (mat.find()) {
System.out.println("[" + mat.group() + "]");
return true;
}else{
return false;
@boodahDEV
boodahDEV / SetColor.c
Created February 19, 2019 13:23
Fuente para setear colores por línea en C, desventaja que se necesita importar la libreria "windows.h" lo cual limita en sistemas Linux.
void SetColor(int ForgC){
WORD wColor;
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbi;
if(GetConsoleScreenBufferInfo(hStdOut, &csbi))
{
wColor = (csbi.wAttributes & 0xF0) + (ForgC & 0x0F);
SetConsoleTextAttribute(hStdOut, wColor);
}