Skip to content

Instantly share code, notes, and snippets.

View Apocryphon-X's full-sized avatar
🌙
I'm pursuing something unattainable

Dante Mendoza Apocryphon-X

🌙
I'm pursuing something unattainable
  • National Polytechnic Institute
  • Redmond, WA (Originally from 🇲🇽)
  • 10:39 (UTC -07:00)
View GitHub Profile
@Apocryphon-X
Apocryphon-X / selenium_disguise.py
Last active January 1, 2024 15:52
Create an instance of Google Chrome (using a Chromedriver) with no infobars and no webdriver console. Works with Python 3 and Selenium == 4.0.0b3.
from subprocess import CREATE_NO_WINDOW
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
service = Service("chromedriver.exe")
service.creationflags = CREATE_NO_WINDOW
chrome_options = webdriver.ChromeOptions()
@Apocryphon-X
Apocryphon-X / chromedriver_without_images.py
Last active January 1, 2024 15:52
Disable image loading for Chromedriver using Python Selenium
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = webdriver.ChromeOptions()
prefs = {"profile.managed_default_content_settings.images": 2}
chrome_options.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(options=chrome_options)
driver.get("https://google.com/")
@Apocryphon-X
Apocryphon-X / fetch_activity.py
Last active February 6, 2022 19:55
Tool to find out which users connected (or not) to an omegaUp contest.
#!/usr/bin/python3
# Copyright (c) 2022 @Apocryphon (Dante Mendoza Leyva).
# All rights reserved.
import omegaup.api
import sys
class Client:
@Apocryphon-X
Apocryphon-X / lock
Last active January 1, 2024 15:50
Symmetric encryption utility. (Wrapper of GPG - For personal use)
#!/usr/bin/python3
# Copyright (c) 2022 @Apocryphon (Dante Mendoza Leyva).
# All rights reserved.
import click
import subprocess
import pathlib
import shutil
import sys
@Apocryphon-X
Apocryphon-X / execute
Last active June 4, 2023 18:18
C++ compiling tool (g++ wrapper). Written for competitive programming and personal use.
#!/usr/bin/python3
# Copyright (c) 2022 @Apocryphon (Dante Mendoza Leyva).
# All rights reserved.
import subprocess
import click
import pathlib
import sys
@Apocryphon-X
Apocryphon-X / vpn.md
Created February 24, 2022 03:11 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@Apocryphon-X
Apocryphon-X / wb-combined.c
Last active November 23, 2023 04:37
Sillicon Valley S03E01 Code - Final Output: 'DREAM_ON_ASSHOLES'
#include <stdio.h>
#include <stdlib.h>
typedef unsigned long u64;
/* Start here */
typedef void enc_cfg_t;
typedef int enc_cfg2_t;
typedef __int128_t dcf_t;
@Apocryphon-X
Apocryphon-X / Reflection-Module.md
Last active May 31, 2024 17:08
Handy V module to simplify the use of compile-time reflection.

Quickstart

Functions available in this module:

  - reflection.(*)_of_type[foo]()  // Extract details from type or struct
  - reflection.(*)_of(bar)         // Extract details from type instance 
  
(*) can be `methods`, `fields` or `attributes`.

Each function returns a map[string]T where T can be FunctionData, FieldData or StructAttribute respectively.

@Apocryphon-X
Apocryphon-X / Segment Tree (Basic Structure).cpp
Last active December 23, 2022 04:33
Iterative implementation of the Segment Tree DS (Basic and non lazy). From: Antii Laaksonen CPHB.
#include <iostream>
using namespace std;
using i64 = long long;
// Memory Required: O(2N)
i64 Tree[i64(2e6) + 1];
i64 N, K, X;
// Puntual Update: O(log N)
@Apocryphon-X
Apocryphon-X / Profile-Comparer.py
Last active June 20, 2024 09:08
Small script to compare two omegaUp profiles (This tool shows you what problems user B doesn't have that user A does).
# MIT License: 2023 - Present
import requests
import os
import sys
import json
from rich import print
API_TOKEN = os.getenv("OMEGAUP_API_TOKEN")