Skip to content

Instantly share code, notes, and snippets.

View XCaminhante's full-sized avatar
🎯
Focusing

X Caminhante XCaminhante

🎯
Focusing
View GitHub Profile
@XCaminhante
XCaminhante / binstore.sh
Created January 6, 2022 16:12
Banco de dados de documentos
#!/bin/bash
#@+leo-ver=5-thin
#@+node:caminhante.20220104131025.1: * @file binstore.sh
#@@first
#@+others
#@+node:caminhante.20220106042659.1: ** Misc
#@+node:caminhante.20220104131041.1: *3* function hash
function hash {
echo -n "$@" | md5sum | cut -d' ' -f1
}
@XCaminhante
XCaminhante / ifm.js
Created October 20, 2021 19:22
Iterar itens no Facebook Marketplace (interface touch.facebook.com)
// Itens no Marketplace Touch
function xpathQuery (query, parent) {
var i = document.evaluate(query, parent, null, XPathResult.ANY_TYPE, null); var a = [];
do { var b = i.iterateNext(); if (b==null) {break;}; a.push(b); } while (true); return a;
}
function clickItems (x) { if (x.length) { x.shift().click(); setTimeout( clickItems.bind(null,x ), 5 ); } }
var a = xpathQuery('//div[@class="_a58 _9_7 _2rgt _1j-g _2rgt"]/img',document); a.shift(); clickItems(a);
@XCaminhante
XCaminhante / t.c
Created February 7, 2021 15:36
Lambda em C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main () {
void (*f)() = // um ponteiro de função
({void _ () {puts("oi");}; &_;}); // uma lambda
f(); // uma chamada de lambda
return 0;
}
#!/usr/bin/env python2
from __future__ import print_function
from docutils import core
from docutils.writers.html5_polyglot import Writer,HTMLTranslator
import sys, os
import getopt
class File ():
def __init__ (self,filename):