Skip to content

Instantly share code, notes, and snippets.

@roijacob
roijacob / millions_formatting.py
Last active October 5, 2025 07:15
Sample Charts on Matplotlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
companies = ['Apple', 'Microsoft', 'Nvidia', 'Alphabet']
rd_spending = [29900000, 27200000, 8800000, 45400000]
# Add bars and labels
bars = plt.bar(companies, rd_spending)
plt.bar_label(bars, labels=[f'${x/1e6:.2f}M' for x in rd_spending])
@roijacob
roijacob / UnderstandingBinding.swift
Last active December 7, 2024 01:03
Source code for my blogs in Substack.
import SwiftUI
struct ContentView: View {
@State private var isSheetPresented = false
@State private var name = "Guest"
var body: some View {
VStack {
Text("Hello, \(name)!")
.font(.title)
@roijacob
roijacob / ContentView.swift
Created January 26, 2024 14:29
A simple application that allows you to input information, store those information in Firebase (Firestore), and render those information inside the application. A great beginner-friendly reference to look into for building iOS apps using SwiftUI and Firebase.
//
// ContentView.swift
// Scratch
//
// Created by Roi Jacob on 1/26/24.
//
import SwiftUI
struct InputView: View {
@roijacob
roijacob / code1_so23_table.sql
Last active November 15, 2023 10:26
PostgreSQL Implementation for my DOVSCU project.
-- Table creation for the 2023 Stack Overflow survey results
CREATE TABLE survey_results_so23 (
"ResponseId" INTEGER PRIMARY KEY,
"Q120" VARCHAR(255),
"MainBranch" VARCHAR(255),
"Age" VARCHAR(255),
"Employment" VARCHAR(255),
"RemoteWork" VARCHAR(255),
"CodingActivities" VARCHAR(255),
"EdLevel" VARCHAR(255),
@roijacob
roijacob / function_transformer.ipynb
Created February 9, 2023 08:36
A guide on how `FunctionTransformer` works in scikit-learn.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@roijacob
roijacob / hash_encoding.ipynb
Last active February 7, 2023 13:30
Compilation of encoding techniques used for machine learning.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.