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 / TuentiPhotoUntag.js
Last active August 29, 2015 13:56
Tuenti Photo Untag Script :: Script que automatiza el proceso de desetiquetarse de fotos. ¿Como se usa? Abre el album de fotos en las que estas etiquetado, pulsa F12 dirígete a la pestaña consola, pega el script y pulsa "Enter".
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();
@davidglezz
davidglezz / getMonthDays.js
Last active August 29, 2015 13:56
Gets the number of days in a month (0-11)
// 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;
@davidglezz
davidglezz / TuentiCommentAutoDelete.js
Last active January 4, 2016 05:49
Tuenti Comment Auto Delete Script :: Script que automatiza el proceso de eliminación de comentarios del tablon. ¿Como se usa? Sitúate en la pagina de tu perfil, Pulsa F12 dirígete a la pestaña consola, pega el script y pulsa "Enter". Ahora no toque nada, los comentarios se irán borrando automáticamente. Probado con Google Chrome 33 y Tuenti 2014…
var intervalo = null;
function DeleteCommentInterval()
{
try {
var coment = document.querySelector("#wallpost-list .itm-actions-trans button.action")
if (coment == null)
{
@davidglezz
davidglezz / TuentiPhotoDownloader.js
Last active January 4, 2016 04:18
Tuenti Photo Downloader Script :: Script que automatiza el navegador y guarda las fotos de la red Social Tuenti con nombre de la fecha en que fueron subidas. ¿Como se usa? Abre un album de fotos, Pulsa F12 dirígete a la pestaña consola, pega el script y pulsa "Enter". Ahora no toque nada, las fotos irán pasando solas y descargándose. Probablemen…
var elementoFoto = null, urlFotoActual = "", urlFotoAnterior = "", intervalo = null, fechaAnt = '', dCont = 0;
function intervalDescargarFoto()
{
try {
elementoFoto = document.getElementById("photo_image");
urlFotoActual = elementoFoto.getAttribute("src");
if (urlFotoActual != urlFotoAnterior)
return;
@davidglezz
davidglezz / utf16_to_utf8.c
Created January 13, 2014 23:11
utf16_to_utf8 function, untested by me, but I hope it works well, comes from opusfile with some modifications.
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
static char* utf16_to_utf8 (const wchar_t *src)
{
size_t len = wcslen(src), si, di;
char *dst = (char*)malloc(sizeof(*dst)*(3*len+1));
@davidglezz
davidglezz / ispow2.c
Created November 5, 2013 11:59
ispow2 function
bool ispow2(int x)
{
return !((~(~0U>>1)|x)&x -1) ;
}
@davidglezz
davidglezz / TurnOffMonitor.c
Created November 5, 2013 11:56
Turn off monitor
#include <windows.h>
#define MONITOR_ON -1
#define MONITOR_OFF 2
#define MONITOR_STANBY 1
int main()
{
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF);
}
@davidglezz
davidglezz / sndPlaySound.c
Created November 5, 2013 11:45
Simple PlaySound (wav files) Example
#include <windows.h>
#include <mmsystem.h>
#include <stdio.h>
int main()
{
sndPlaySound("file.wav", SND_ASYNC | SND_FILENAME | SND_LOOP);
getchar();
return 0;
}
@davidglezz
davidglezz / GetSetCursorPos.c
Created November 5, 2013 11:29
Get & Set Cursor position
#include <stdio.h>
#include <windows.h>
int main()
{
// GetCursorPos
puts("Press F8 to next example\n");
POINT p;
while(!GetAsyncKeyState(VK_F8))
{
@davidglezz
davidglezz / HotKeys.c
Created November 5, 2013 11:17
HotKeys demo
#include <windows.h>
#define CTRL_ALT_F1 101
#define CTRL_F2 102
#define ALT_F3 103
#define CTRL_UP 104
#define CTRL_DOWN 105
#define CTRL_RIGHT 106
#define CTRL_LEFT 107
#define EXIT_KEYS 108