Skip to content

Instantly share code, notes, and snippets.

View Oyelowo's full-sized avatar

Oyelowo

View GitHub Profile
@Oyelowo
Oyelowo / webdev_online_resources.md
Created July 17, 2018 05:38 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@Oyelowo
Oyelowo / App.js
Created November 17, 2021 05:54 — forked from ben-rogerson/App.js
A breakpoint provider that syncs up with your screens in tailwind.config.js. Common use is to fully remove elements from the dom rather than hide them with css.
import React from 'react';
import { useMinScreen } from './minScreen';
const App = () => {
const { min } = useMinScreen();
return (
<>
{min`md` && <div>I'll show at md and up</div>}
{!min`lg` && <div>I'll show at up to lg</div>}
@Oyelowo
Oyelowo / linux_users_management.md
Created March 27, 2022 07:04 — forked from AjeetK/linux_users_management.md
User Management in Linux

Types of user:

  1. Root User - It is the super user which can run any command generally used for administration.
  2. System User - Users needed for system specific operation/components, like mysql user to run mysql.
  3. Normal User - Other users which are created by root and have limited access given to them.

Attributes:

  1. User Type: Super user
  2. User Name: root
plugins=(
git
rust
node
aws
deno
emoji
gh
git-auto-fetch
git-escape-magic
@Oyelowo
Oyelowo / init.vim
Created May 31, 2022 09:05 — forked from celso/init.vim
Neovim setup for OSX users
syntax on
set ruler " Show the line and column numbers of the cursor.
set formatoptions+=o " Continue comment marker in new lines.
set textwidth=0 " Hard-wrap long lines as you type them.
set modeline " Enable modeline.
set esckeys " Cursor keys in insert mode.
set linespace=0 " Set line-spacing to minimum.
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
" More natural splits
set splitbelow " Horizontal split below current.
@Oyelowo
Oyelowo / .zhrc
Created May 31, 2022 15:15
My zhrc config file with oh-my-zsh at ~/.zhrc
bindkey -e
Last login: Tue May 31 11:28:05 on ttys009
➜ ~ vi ~/.zshrc
➜ ~ source ~/.zshrc
➜ ~ cat ~/.zshrc
bindkey -e
bindkey '\e\e[C' forward-word
@Oyelowo
Oyelowo / blog1
Created June 1, 2022 15:12
Blogpost1
The nuances of Rust's `impl Trait` syntactic sugar
A brief discussion in a discord channel about language design is the motivation behind this writing.
What happens when you have gthe function below:
```rs
trait Speed { }
fn get_oyelowo(arg1: impl Speed , arg2: impl Speed) {
@Oyelowo
Oyelowo / README.md
Created June 25, 2022 12:37 — forked from exupero/README.md
Alias a domain to a local port (Mac)

I run a lot of web servers for different projects, all of them on different ports. Generally I start with port 8000 and increment from there as I spin up new servers, but it became tiresome to remember what projects were running on which ports and what the next available port was.

/etc/hosts won't let you specify a port, but a combination of aliasing 127.0.0.1 to 127.0.0.X, forwarding ports from 8000 to 80, and adding the 127.0.0.X IP under an alias in /etc/hosts did work.

This script finds the next available value of X, aliases it with ifconfig, forwards the given port to port 80 with ipfw, and adds a new entry to /etc/hosts that aliases the IP to the domain you want.

Now I can add a server alias with sudo domain-alias funproject 8000, run the web server at 127.0.0.X:8000, and load up http://funproject/ in my browser.

(Because I needed it to work on a Mac, I couldn't use iptables. ipfw seems to work, though its manpage claims it's deprecated and pfctl is the way to go. I wasn't able to figure

@Oyelowo
Oyelowo / k3s-on-multipass-vm-m1-mac.sh
Created October 17, 2022 21:41
Launch a lightweight virtual machine on M1 MAC with k3s installed: https://github.com/canonical/multipass
# Virtual machine multipass
brew install --cask multipass
multipass launch --name k3s --mem 4G --disk 40G
multipass shell k3s
# From inside the VM run:
ubuntu@k3s:~$ curl -sfL https://get.k3s.io | sh -
@Oyelowo
Oyelowo / argoEventsSchema.yaml
Created November 3, 2022 04:06
Argo events json schema
This file has been truncated, but you can view the full file.
$id: http://events.argoproj.io/events.json
$schema: http://json-schema.org/schema#
definitions:
io.argoproj.common.Amount:
description: Amount represent a numeric amount.
type: number
io.argoproj.common.Backoff:
description: Backoff for an operation
properties: