Skip to content

Instantly share code, notes, and snippets.

View leoriviera's full-sized avatar
💻

Leo. leoriviera

💻
View GitHub Profile
@leoriviera
leoriviera / sankey.js
Created January 19, 2025 21:08
script to generate sankeymatic.com markup for job interview stages
const input = `
LinkedIn, Applied, Initial interview, Pending interview
cord.co (inbound), Applied, Initial interview, Pending response
cord.co (inbound), Applied, Pending response
cord.co (inbound), Applied, Initial interview, Pending response
Referral, Applied, Pending response
Search, Applied, Pending interview
cord.co (inbound), Applied, Initial interview, Pending response
Wellfound, Applied, Stalled
Speculative, Applied, Stalled
import string
def get_unique_letters(l):
return list(set([c for c in l if c in string.ascii_lowercase]))
def matches_correct(guess, correct_format):
for i in range(5):
if(correct_format[i] == '?'):
@leoriviera
leoriviera / traverse.mjs
Last active April 20, 2022 21:50
Code to set Firebase's `.runtimeconfig.json` to Firebase's environmental variables.
import { readFileSync, writeFileSync } from "fs";
/**
* A function which traverses and object, retrieving keys and values.
* @param {Object} o the object to be traversed
* @param {string} p the dot notation for the object, o
* @returns {string[]} the keys and values of the object
*/
const traverse = (o, p = "") => {
return Object.entries(o)
@leoriviera
leoriviera / zip.ts
Created November 5, 2021 16:16
A zip function written in TypeScript
export const zip = <P, Q>(
a: P[],
b: Q[]
): [P, Q][] => a.map((k, i) => [k, b[i]]);
@leoriviera
leoriviera / list-open.py
Last active February 23, 2021 16:12
A utility to open domains from a text file using the default browser
import subprocess
import webbrowser
def open_page(page_url):
webbrowser.open(page_url)
filename = input('Default file name is page-list.txt. Enter file name if different.\n')
# incognitoOn = input('Incognito mode on? y/N\n')
# incognitoOn = '-incognito' if incognitoOn == 'y' else ''
// A JS file that uses Firebase, moment.js, l1.io and js_cookie to track time of access and IP address
// Dependencies include
// - https://cdn.rawgit.com/moment/moment/develop/min/moment.min.js
// - https://www.gstatic.com/firebasejs/4.1.3/firebase.js
// - https://l2.io/ip.js?var=userip
// Insert Firebase configuration data here!
firebase.initializeApp(config);
database = firebase.database();