Skip to content

Instantly share code, notes, and snippets.

View omofolarin's full-sized avatar

shonibare omofolarin omofolarin

View GitHub Profile
@omofolarin
omofolarin / tracing-instrument-macro.md
Created June 26, 2025 04:31 — forked from oliverdaff/tracing-instrument-macro.md
Tutorial on Using the tracing::instrument Macro in Rust

Tutorial on Using the tracing::instrument Macro in Rust

Introduction

This document provides a comprehensive guide on using the tracing::instrument macro in Rust. It covers the basics of the tracing crate, the purpose and functioning of the instrument macro, and best practices for its effective use in software development.

What is the tracing::instrument Macro?

  • Overview: The tracing crate is a collection of Rust libraries for application-level tracing and asynchronous diagnostics. It provides a framework for collecting structured, event-based diagnostic information. The instrument macro, specifically, is a part of this crate. It automatically attaches context-specific information to logs, such as function arguments and return values, making it easier to track the flow and performance of the code.

  • Purpose: The primary purpose of the tracing::instrument macro is to aid in diagnostics and performance analysis. By annotating functions with this macro, developers can automatic

@omofolarin
omofolarin / ultralearning.md
Created April 28, 2025 00:23 — forked from hlfshell/ultralearning.md
Ultralearning Notes

Ultralearning

The following is the notes I took years ago on the book Ultralearning by Scott Young. The bombastic title and promise to learn virtually anything quickly makes it sound as if its the typical marketing-powered fluff-filled nonfiction book stores are overflowing with, but something about this book stuck with me. After finishing it I quickly went back and wrote these thoughts down. While I don't follow his layout of plans regularly, I have used it to guide a lot of my own self education.

I've successfully utilized it when I needed to refresh on mathematics for my Master's degree (a host of skills that atrophied sigificantly for the dozen years between undergrad and the masters). I've also used it to self-study subjects like Robotics and Deep Learning (though I did decide in the end to go for the Master's accreditation).

I share it here with hopes that someone finds it useful.


Principle 1 - Metalearning

@omofolarin
omofolarin / 0_README.md
Created March 25, 2025 15:48 — forked from dhoeric/0_README.md
Google Calendar - Public Holiday Calendars
@omofolarin
omofolarin / 1-zig-cheatsheet
Created August 24, 2024 11:22 — forked from jdmichaud/1-zig-cheatsheet
Zig cheatsheet
https://ziglang.org/documentation/master/#Pointers
*T - single-item pointer to exactly one item.
Supports deref syntax: ptr.*
[*]T - pointer to unknown number of items. (eq. of *T in C)
Supports index syntax: ptr[i]
Supports slice syntax: ptr[start..end]
Supports pointer arithmetic: ptr + x, ptr - x
@omofolarin
omofolarin / goggle-maps-extract-city-country.js
Created February 19, 2024 12:45 — forked from vitaliy-kravchenko-dev/goggle-maps-extract-city-country.js
Extract city and country from Google maps API response - geocoder.geocode()
getCityCountry(results) {
const location: any = {};
for (const component of results[0].address_components) {
if (component.types.includes('sublocality') || component.types.includes('locality')) {
location.city = component.long_name;
} else if (component.types.includes('administrative_area_level_1')) {
location.state = component.short_name;
} else if (component.types.includes('country')) {
location.country = component.long_name;
@omofolarin
omofolarin / phase.js
Created September 3, 2023 22:26
page-view-example
import {
ImageBackground,
SafeAreaView,
StyleSheet,
Text,
TouchableOpacity,
View,
useWindowDimensions,
} from "react-native";
import React, { forwardRef, useRef, useState } from "react";

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@omofolarin
omofolarin / chat_message_render_box.dart
Created May 26, 2023 10:08 — forked from craiglabenz/chat_message_render_box.dart
Demonstrates a custom RenderObject that draws chat messages like WhatsApp, where the `sentAt` timestamp is tucked into the last line if it fits
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@omofolarin
omofolarin / learn.md
Created February 8, 2023 07:13 — forked from rylev/learn.md
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.