This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// without lookup table | |
function getMonthDays_A (month, year) | |
{ | |
if (month === 1) | |
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0) ? 29 : 28; | |
if (month % 2) | |
return month > 6 ? 31 : 30; | |
return month > 6 ? 30 : 31; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var urlFotoAnterior = ""; | |
var interval = setInterval(function() { | |
try { | |
var urlFotoActual = document.getElementById("photo_image").getAttribute("src"); | |
if (urlFotoActual != urlFotoAnterior) | |
{ | |
urlFotoAnterior = urlFotoActual; | |
document.querySelector("#edit_tag_list .js-deleteTag .avatar").click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var urlFotoAnterior = ""; | |
var interval = setInterval(function (){ | |
try { | |
var urlFotoActual = document.getElementById("photo_image").getAttribute("src"); | |
if (urlFotoActual != urlFotoAnterior) | |
{ | |
urlFotoAnterior = urlFotoActual; | |
document.getElementById("photo-actions-remove").click(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in `seq 1 1000`; do | |
mkdir -p files-$i; | |
for j in `seq 1 100`; do | |
dd if=/dev/zero of=files-$i/$j bs=100k count=1 2> /dev/null; | |
done; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline int FastFtol(const float a) | |
{ | |
static int b; | |
#if defined(_MSVC) | |
__asm fld a | |
__asm fistp b | |
#elif defined(__GNUG__) | |
// use AT&T inline assembly style, document that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void StrTrimLeft(char *source, char *dest) | |
{ | |
int nIndex = 0; | |
while (source[nIndex] == ' ') | |
nIndex++; | |
strcpy(dest, &source[nIndex]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void removeQuotes(LPSTR szCommand) | |
{ | |
int nGet = 0, nSet = 0; | |
while (szCommand[nGet] != '\0') | |
{ | |
if (szCommand[nGet] == '\"') | |
nGet++; | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int GetColorsBits() | |
{ | |
HDC hScreenDC = GetDC(0); | |
int nColorBits = GetDeviceCaps(hScreenDC, BITSPIXEL) * GetDeviceCaps(hScreenDC, PLANES); | |
ReleaseDC(NULL, hScreenDC); | |
return nColorBits; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Display 'Open File' dialog-box | |
BOOL OpenFileDialog(LPSTR lpFilename) | |
{ | |
OPENFILENAME of; | |
char szFilter[] = "Music Files (*.ogg)\0*.ogg\0Image Files (*.png)\0*.png\0All files (*.*)\0*.*\0\0"; | |
char szFile[MAX_PATH] = "\0"; | |
char szTitle[] = "Select a file"; | |
char szExt[] = "ogg"; | |
of.lStructSize = sizeof(of); |
OlderNewer