Skip to content

Instantly share code, notes, and snippets.

View dcinzona's full-sized avatar
๐Ÿ†”
๐Ÿง‘โ€๐Ÿ’ป๐ŸŒŽ๐ŸŒŽ๐ŸŒŽโ˜๏ธ

Gustavo Tandeciarz dcinzona

๐Ÿ†”
๐Ÿง‘โ€๐Ÿ’ป๐ŸŒŽ๐ŸŒŽ๐ŸŒŽโ˜๏ธ
View GitHub Profile
@dcinzona
dcinzona / commands.sh
Last active October 4, 2025 19:04
VSCode on Windwos with WSL + Python + Jupyter
# ๐Ÿ’ป Commands
# Install WSL with Ubuntu
wsl --install -d Ubuntu
wsl --set-default Ubuntu
# Update Ubuntu
sudo apt update && sudo apt upgrade -y
# Download and install Anaconda
cd ~
@dcinzona
dcinzona / CommunityRoundRobinRegHandler.cls
Last active June 21, 2024 02:57
registration handler with deactivation future
global class CommunityRoundRobinRegHandler implements Auth.ConfigurableSelfRegHandler {
private final Long CURRENT_TIME = Datetime.now().getTime();
private final String[] UPPERCASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
private final String[] LOWERCASE_CHARS = 'abcdefghijklmnopqrstuvwxyz'.split('');
private final String[] NUMBER_CHARS = '1234567890'.split('');
private final String[] SPECIAL_CHARS = '!#$%-_=+<>'.split('');
// This method is called once after verification (if any was configured)
// This method should create a user and insert it
@dcinzona
dcinzona / JitHandler.cls
Created June 20, 2024 13:03 — forked from wesley-chiSFDC/JitHandler.cls
JIT Handler Round Robin
public with sharing class JitHandler implements Auth.SamlJitHandler {
public class JitException extends Exception {}
public User createUser(Id samlSsoProviderId, Id communityId, Id portalId,
String federationIdentifier, Map<String, String> attributes, String assertion) {
User u = new User();
handleJit(true, u, samlSsoProviderId, communityId, portalId,
federationIdentifier, attributes, assertion);
return u;
}
@dcinzona
dcinzona / ping_check.py
Last active July 18, 2023 04:06
connection-check
import os
import time
def write_to_log(log_message):
with open('network_status.log', 'a') as log_file:
log_file.write(log_message + '\n')
def is_connected():
if os.name == 'nt':
return is_connected_win()
#!/usr/bin/env python3
"""
Author: Teddy Xinyuan Chen
Date: 2020-08-17
"""
from functools import cache
from pathlib import Path
from subprocess import run
import re
@dcinzona
dcinzona / scrape_wayback.py
Last active November 21, 2022 14:28
A quick and dirty python script I used to pull down all my old images from the web.archive.org cache of my ghost blog after losing them during a server migration...
import re
import requests
from bs4 import BeautifulSoup
import os
SITE = "https://tandeciarz.com"
# this will end up being the archive URL
AURL = SITE
# timestamp for date before the snapshot I want to scrape
ts = "20221010"
@dcinzona
dcinzona / headMarkup.js
Last active December 6, 2022 18:21
Salesforce Communities multi-language omnistudio fix
//find the sessionStorage key that contains the UserLocale value
function getOmniLangKey(){
for(let i=0; i<sessionStorage.length; i++){
let key = sessionStorage.key(i);
if (key === 'LSSIndex:SESSION{"namespace":"omnistudio"}'){
let omniSession = JSON.parse(sessionStorage.getItem(key));
return omniSession.userLocale
}
}
return null;
@dcinzona
dcinzona / monitor.py
Last active November 10, 2022 16:49
Monitor network connectivity to the internet via python
import os
import socket
import datetime
import time
FILE = os.path.join(os.getcwd(), "networkinfo.log")
DBG = False
@dcinzona
dcinzona / VisualForcePageUsage.vfp
Created April 22, 2022 16:29
Visualforce Page Metrics
<!--
- Created by gtandeciarz on 6/21/17.
-->
<apex:page id="VisualForcePageUsage"
title="VisualForce Page Metrics"
readOnly="true"
standardStylesheets="false"
>
<!--
@dcinzona
dcinzona / readlog.py
Last active February 3, 2022 22:43
Saleforce Log File SOQL Query parser
"""
Run via command line: python3 readlog.py [logfile] [optional:outputfilecsv]
Requires Python 3.6 or higher
"""
import os,sys,re,traceback
#import Operations.Operation as Operation
"""
15:05:12.412 (20450194753)|CODE_UNIT_STARTED|[EXTERNAL]|Flow:01Ir0000000HCxR
15:05:12.412 (20747809148)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01Ir0000000HCxE
15:05:12.893 (21137018664)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:PersonAccount:001r000000l8CIV