Skip to content

Instantly share code, notes, and snippets.

View rubenvarela's full-sized avatar

Rubén Varela rubenvarela

View GitHub Profile
import requests
from urllib.parse import urljoin, quote, unquote
from pathlib import Path
import xml.etree.ElementTree as ET
from typing import List, Dict, Optional
import time
import argparse
class S3BucketDownloader:
def __init__(self, bucket_url: str, root_dir: str = '', local_dir: str = 'downloaded',
@rubenvarela
rubenvarela / TownSquare Media - Brand URLs.txt
Last active April 25, 2025 23:03
TownSquare Media - Brand URLs - All URLs extracted from: https://www.townsquaremedia.com/local-media/brands
https://920espnnewjersey.com/
https://wakeupwyo.com/
https://mycountry955.com/
https://k2radio.com/
https://kisscasper.com/
https://rock967online.com/
https://jackfmcasper.com/
https://caspercowboy.com/
https://7220sports.com/
https://1063nowfm.com/
@rubenvarela
rubenvarela / requirements.txt
Created November 9, 2023 11:49
stable diffusion test
torch
diffusers
transformers
pandas
@rubenvarela
rubenvarela / requirements.txt
Created November 9, 2023 00:58
Correr Whisper en Perro Negro como benchmark
git+https://github.com/openai/whisper.git
transformers
pytube
pandas
@rubenvarela
rubenvarela / backfill.sh
Created August 25, 2023 12:27
drupal exports webforms daily
#!/bin/bash
# Export historical webform data -- some variables assume an acquia environment -- adjust as needed
cd /var/www/html/"$AH_SITE_GROUP"."$AH_SITE_ENVIRONMENT"/docroot/
DATE_COMMAND="date" # on mac, change to gdate from homebrew's 'coreutil' package
LOCATION="/var/www/html/$AH_SITE_GROUP.$AH_SITE_ENVIRONMENT/docroot/sites/default/files/webform_exports"
today=$($DATE_COMMAND +"%Y-%m-%d %H:%M:%S")
@rubenvarela
rubenvarela / script.scpt
Created August 25, 2023 05:31
apple script to bring iterm to the front and hit enter -- (keep ssh connection active for example)
set i to 0
repeat while i < 15
-- set i to i + 1
-- https://eastmanreference.com/complete-list-of-applescript-key-codes
-- https://apple.stackexchange.com/questions/63897/can-a-mac-be-programmed-to-simulate-pressing-a-key-at-a-certain-rate-via-softwar
delay 20
tell application "iTerm" to activate
delay 1
@rubenvarela
rubenvarela / browser console.md
Last active January 24, 2023 19:34
2023-01-24 - jupyter-scheduler - issue - browser console
Starting WebSocket: ws://192.168.138.46:8888/api/kernels/7fc29ef2-8243-4e53-8ab6-9587b75b2832 [jlab_core.6144df8e3fe03e33f880.js:2:989853](http://192.168.138.46:8888/static/lab/jlab_core.6144df8e3fe03e33f880.js?v=6144df8e3fe03e33f880)
XHRGEThttp://192.168.138.46:8888/scheduler/runtime_environments?1674587878945
[HTTP/1.1 500 Internal Server Error 18ms]

Uncaught (in promise) Error: Unhandled error
    r http://192.168.138.46:8888/static/lab/jlab_core.6144df8e3fe03e33f880.js?v=6144df8e3fe03e33f880:2
    T http://192.168.138.46:8888/lab/extensions/@jupyterlab/scheduler/static/497.e83f20d14e3071f8fd16.js?v=e83f20d14e3071f8fd16:1
    getRuntimeEnvironments http://192.168.138.46:8888/lab/extensions/@jupyterlab/scheduler/static/497.e83f20d14e3071f8fd16.js?v=e83f20d14e3071f8fd16:1
    de http://192.168.138.46:8888/lab/extensions/@jupyterlab/scheduler/static/497.e83f20d14e3071f8fd16.js?v=e83f20d14e3071f8fd16:1
@rubenvarela
rubenvarela / main.py
Created November 19, 2022 02:36
BigQuery - JSON schema to basic Python Schema
#!/usr/bin/env python3
import sys
import json
# used as
# bq show --schema --format=prettyjson PROJECT:DATASET.TABLE | ./main.py
data = ""
for x in sys.stdin:
data = data + x
@rubenvarela
rubenvarela / read.md
Created April 11, 2022 21:44
levels.fyi - returning bad salaryData.json

I see online, in multiple places, people saying that levels.fyi data is on a JSON at,

https://www.levels.fyi/js/salaryData.json

This may have been how it was built originally but now, while it still responds with a JSON, it's not accurate.

First, we can see the file hasn't been modified since Jan 13, 2022.

$ curl -I "https://www.levels.fyi/js/salaryData.json"

HTTP/2 200

@rubenvarela
rubenvarela / custom_join.module
Created March 19, 2021 11:34
drupal 8, drupal 9 - Views - Add extra condition on join
<?php
/**
* @file
* Primary module hooks for custom_join module.
*/
use Drupal\views\Plugin\views\query\QueryPluginBase;
use Drupal\views\ViewExecutable;