Skip to content

Instantly share code, notes, and snippets.

View dalleng's full-sized avatar
👀

Diego Allen dalleng

👀
View GitHub Profile
@dalleng
dalleng / descargarBoleta.js
Last active September 20, 2015 21:46
Descargar boleta de pago de marangatu con casperjs
// Ejecutar
// casperjs descargarBoleta.js --ruc=ruc --password=password --taxCode=135,133
var casper = require('casper').create({
clientScripts: ['jquery.js'],
logLevel: 'debug',
verbose: true
});
casper.options.waitTimeout = 30000;
@dalleng
dalleng / datosBasicosContribuyente.js
Last active March 22, 2024 13:20
Ejemplo para extraer datos básicos del contribuyente de marangatu usando casperjs. Uso: casperjs datosBasicosContribuyente.js --ruc=ruc --password=password
var casper = require('casper').create({
clientScripts: ['jquery.js'],
});
var data = {};
var ruc = casper.cli.get('ruc');
var password = casper.cli.get('password');
casper.start('https://marangatu.set.gov.py/eset/').thenEvaluate(function login(ruc, password) {
@dalleng
dalleng / gist:090587a4bc487423fecf
Created April 16, 2015 22:55
Print char binary representation
void printb(unsigned char byte) {
unsigned char mask = 128;
for (int i = 0; i < 8; i++) {
printf("%d", byte & (mask >> i) ? 1 : 0);
}
printf("\n");
}
@dalleng
dalleng / gist:5af1b9768bd3416d49cc
Last active August 29, 2015 14:19
Print 32 bit int as 4 binary octets
void printbint(unsigned int u32int) {
unsigned int mask = 1 << 31;
for (int i = 0; i < 32; i++) {
printf("%d", u32int & (mask >> i) ? 1 : 0);
if ((i + 1) % 8 == 0) {
printf(" ");
}
}
printf("\n");
}
@dalleng
dalleng / save_icon_osx.py
Last active August 29, 2015 14:13
Saves the icon of a running app with a given pid
import sys
from Cocoa import NSDictionary, NSNumber
from AppKit import NSRunningApplication, NSImageCompressionFactor, NSBitmapImageRep, NSPNGFileType
app = NSRunningApplication.runningApplicationWithProcessIdentifier_(int(sys.argv[1]))
icon = app.icon()
image_data = icon.TIFFRepresentation()
image_rep = NSBitmapImageRep.imageRepWithData_(image_data)
image_props = NSDictionary.dictionaryWithObject_forKey_(NSNumber.numberWithFloat_(1.0), NSImageCompressionFactor)

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: