Skip to content

Instantly share code, notes, and snippets.

View vperezb's full-sized avatar
😎
Easy

vperezb vperezb

😎
Easy
View GitHub Profile
@vperezb
vperezb / bisac.csv
Created May 28, 2025 18:23 — forked from jveldboom/bisac.csv
BISAC codes and values
ANT000000 Antiques & Collectibles / General
ANT001000 Antiques & Collectibles / Americana
ANT002000 Antiques & Collectibles / Art
ANT003000 Antiques & Collectibles / Autographs
ANT005000 Antiques & Collectibles / Books
ANT006000 Antiques & Collectibles / Bottles
ANT007000 Antiques & Collectibles / Buttons & Pins
ANT008000 Antiques & Collectibles / Care & Restoration
ANT009000 Antiques & Collectibles / Transportation
ANT010000 Antiques & Collectibles / Clocks & Watches
@vperezb
vperezb / image_from_url_to_ftp.py
Created May 23, 2020 17:40
Download an image from internet and upload it to ftp server
import io
import requests
from PIL import Image
import ftplib
credentials = {
'host': 'blabla.com',
'user': 'myuser',
'password': 'mypass'
<!DOCTYPE html>
<!-- For any support contact me on https://www.linkedin.com/in/vperezb-/ or https://www.malt.es/profile/victorperezberruezo-->
<html>
<head>
<meta charset="UTF-8">
<script>
function generateQr() {
@vperezb
vperezb / redirector.html
Last active March 29, 2020 16:54
Setup a redirector with stats that allows you to track the amount of people used the url
<head>
<!-- For any support contact me on https://www.linkedin.com/in/vperezb-/ or https://www.malt.es/profile/victorperezberruezo-->
<meta charset="UTF-8">
<style>
/* Styles to create the simple loader, source https://www.cssscript.com/minimal-fullscreen-content-loader-h5loading-js/ */
html{height:100%;padding:0;margin:0}body{padding:0;margin:0}.H5_loading{z-index:999999;display:none;background-color:rgba(0,0,0,.2);width:100%;height:100%;position:fixed;top:0;left:0;opacity:0;filter:alpha(0);-moz-opacity:0}@-webkit-keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@-moz-keyframes fadeIn{from{-moz-opacity:0}to{-moz-opacity:1}}@-ms-keyframes fadeIn{from{filter:alpha(0)}to{filter:alpha(1)}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}@-webkit-keyframes fadeOut{from{opacity:1}to{opacity:0}}@-moz-keyframes fadeOut{from{-moz-opacity:1}to{-moz-opacity:0}}@-ms-keyframes fadeOut{from{filter:alpha(1)}to{filter:alpha(0)}}.H5_loading .H5_loading_process{width:7rem;height:7re
@vperezb
vperezb / qr_generator.js
Last active March 29, 2020 16:55
Create a QR using Google Infographic API in JS
function generateQR(placeholderImageId) {
// For any support contact me on https://www.linkedin.com/in/vperezb-/ or https://www.malt.es/profile/victorperezberruezo
// Define your final url, the one where the user will arrive
var finalURL = 'https://www.tiendeo.com?utm_source=tiendeo?utm_medium=qr_post';
// Encode this url
var finalURLEncoded = encodeURIComponent(finalURL);
// Define the other variables (the ones you want to have in the redirector in order to
var identifyer = 'medium_post';
var version = 'first_version';
// Define the url where the redirector is hosted
@vperezb
vperezb / execute_apps_script.py
Last active April 29, 2024 07:46
Execute Google Sheets Macro or Apps Script Programatically using python and Google Apps Script API
'''
Gist from the post https://medium.com/@victor.perez.berruezo/execute-google-apps-script-functions-or-sheets-macros-programmatically-using-python-apps-script-ec8343e29fcd
Code partially from Google Apps Script Quickstart https://developers.google.com/apps-script/api/quickstart/python
'''
import pickle
import os.path
from googleapiclient import errors
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
def text_replace(old: str, new: str, presentation_id: str, pages: list = []):
slides_service = get_service(
secrets_path,
'https://www.googleapis.com/auth/presentations',
'presentations',
'v1'
)
service.presentations().batchUpdate(
body={
def get_service(secrets_path, service_scope, service_build, service_version):
credentials = ServiceAccountCredentials.from_json_keyfile_name(
secrets_path,
scopes= service_scope
)
service = build(
service_build,
service_version,
http=credentials.authorize(Http()),
cache_discovery=False