Skip to content

Instantly share code, notes, and snippets.

View davidglezz's full-sized avatar
😃
Happy

David Gonzalez davidglezz

😃
Happy
View GitHub Profile
@davidglezz
davidglezz / GetColorsBits.c
Created November 4, 2013 16:17
Get the number of color bits in the current screen device.
int GetColorsBits()
{
HDC hScreenDC = GetDC(0);
int nColorBits = GetDeviceCaps(hScreenDC, BITSPIXEL) * GetDeviceCaps(hScreenDC, PLANES);
ReleaseDC(NULL, hScreenDC);
return nColorBits;
}
@davidglezz
davidglezz / removeQuotes.c
Last active October 12, 2024 23:23
Remove quotes from command line arguments
void removeQuotes(LPSTR szCommand)
{
int nGet = 0, nSet = 0;
while (szCommand[nGet] != '\0')
{
if (szCommand[nGet] == '\"')
nGet++;
else
{
@davidglezz
davidglezz / StrTrimLeft.c
Created November 4, 2013 16:12
This function remove whitespaces from the beginning.
void StrTrimLeft(char *source, char *dest)
{
int nIndex = 0;
while (source[nIndex] == ' ')
nIndex++;
strcpy(dest, &source[nIndex]);
}
@davidglezz
davidglezz / id3v1_genres.sql
Created November 3, 2013 17:52
id3v1 genres
INSERT INTO `music`.`genre`
VALUES (0, 'Blues'),
(1, 'Classic Rock'),
(2, 'Country'),
(3, 'Dance'),
(4, 'Disco'),
(5, 'Funk'),
(6, 'Grunge'),
(7, 'Hip-Hop'),
(8, 'Jazz'),