Skip to content

Instantly share code, notes, and snippets.

View omofolarin's full-sized avatar

shonibare omofolarin omofolarin

View GitHub Profile
@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.

A Context Map Should Answer:

  • Where is the technical debt?
  • Where are the areas of technical risk?
  • What knowledge gaps do you have?

Spectrum of cooperation

@omofolarin
omofolarin / hobbies.js
Created December 19, 2022 21:14 — forked from AllanPooley/hobbies.js
Compiled List of Hobbies Array
const interests = [
'3D printing',
'Amateur radio',
'Scrapbook',
'Amateur radio',
'Acting',
'Baton twirling',
'Board games',
'Book restoration',
'Cabaret',
@omofolarin
omofolarin / home.dart
Created November 21, 2022 20:07 — forked from NeatSnippets/home.dart
How to hide bottom navigation bar when scrolling in Flutter
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Home extends StatefulWidget {
Home({Key key}) : super(key: key);
@override
_HomeState createState() => _HomeState();
}