Skip to content

Instantly share code, notes, and snippets.

View rendon's full-sized avatar
🧑‍🔬
Trying new things out.

Rafael Rendón rendon

🧑‍🔬
Trying new things out.
View GitHub Profile
@rendon
rendon / LeetCodeHelper.js
Last active September 15, 2023 22:54
A script to copy LeetCode problem IDs to the clipboard
// ==UserScript==
// @name LeetCode Helper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Facilitate interactions with the LeetCode website. It adds one button on the top-left to easily copy the problem ID and problem URL.
// @author Rafael Rendon Pablo
// @match https://leetcode.com/problems/*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=leetcode.com
// @run-at document-idle
// @grant none
@rendon
rendon / base64.cpp
Created August 4, 2023 03:30
Basic Base64 encoding
// Reference: https://en.wikipedia.org/wiki/Base64
#include <bits/stdc++.h>
using namespace std;
const char* alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int getValue(char c) {
int len = strlen(alphabet);
for (int i = 0; i < len; i++) {
if (c == alphabet[i]) { return i; }