Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View BolajiOlajide's full-sized avatar

Bolaji Olajide BolajiOlajide

View GitHub Profile
@BolajiOlajide
BolajiOlajide / gradient.js
Created October 26, 2023 12:59
svelte-paint-gradient.js
export function paint(context, t) {
const { width, height } = context.canvas;
const imageData = context.getImageData(0, 0, width, height);
for (let p = 0; p < imageData.data.length; p += 4) {
const i = p / 4;
const x = i % width;
const y = (i / width) >>> 0;
const red = 64 + (128 * x) / width + 64 * Math.sin(t / 1000);
@BolajiOlajide
BolajiOlajide / rbac_test_plan.md
Last active March 17, 2023 19:41
RBAC Test Plan

QA Test Plan

Summary

To ensure that the implemented Role-Based Access Control (RBAC) system meets the functional and non-functional requirements specified in the project scope and meets the expectations of stakeholders, we are outlining this test plan.

This project adds the following functionality to Sourcegraph:

@BolajiOlajide
BolajiOlajide / GettingStartedWithJetbrains.md
Created October 7, 2022 13:51
Things to know when switching to Jetbrains (especially from VSCode)

I recently started trying out GoLand for development, I've heard good things about the product from my colleagues at Sourcegraph. The one thing that caught my eye was the better intellisense it had. I decided to signup for a trial (even though we had a company license, I did this because I wanted to be sure I was going to use the IDE so I don't take up a seat).

One of things that first confused is that Cmd + P which I used to look for files in VSCode wasn't a thing in Jetbrain products.

Apparently, there's a VSCode keymap plugin for Jetbrains that can be used to remap your keys so it works like VSCode.

If you don't want to install the plugin, you can change the mapping yourself by navigating to Preferences > Keymap and search for “go to file” and update the mapping.

@BolajiOlajide
BolajiOlajide / aggregate.js
Created December 18, 2021 21:10
Delete your tweets from your account
const fs = require('fs');
const tweet_1 = require('./data/tweet.js');
const tweet_2 = require('./data/tweet-part1.js');
const totalTweets = [...tweet_1, ...tweet_2].map(({ tweet }) => ({
id: tweet.id_str,
createdAt: tweet.created_at
}));
@BolajiOlajide
BolajiOlajide / aggregator.js
Created August 16, 2021 01:57
2021 Delete Tweets Script using twitter's export tool
const fs = require('fs');
const tweet_1 = require('./data/tweet.js');
const tweet_2 = require('./data/tweet-part1.js');
const totalTweets = [...tweet_1, ...tweet_2].map(({ tweet }) => ({
id: tweet.id_str,
createdAt: tweet.created_at
}));
#!/bin/python3
"""
A Python script to delete tweets.
• It uses tweet ids from a Twitter archive to bypass the Twitter API limit. Use this script if you need to delete more
than 3200 tweets and what's in your archive is a tweets.csv file.
• If you have more than 3200 tweets but your archive has a tweets.json file use this:
https://gist.github.com/flesueur/bcb2d9185b64c5191915d860ad19f23f
@BolajiOlajide
BolajiOlajide / proton_vs_code.json
Created June 1, 2021 20:17
Proton's 2021 VSCode config (Last Updated: 1st June 2021)
{
"editor.lineHeight": 25,
"editor.letterSpacing": 0.5,
"files.trimTrailingWhitespace": true,
"editor.renderWhitespace": "all",
"workbench.iconTheme": "material-icon-theme",
"editor.fontSize": 14,
"workbench.sideBar.location": "left",
"editor.fontLigatures": true,
"workbench.startupEditor": "none",
@BolajiOlajide
BolajiOlajide / fastapi-koii.py
Created May 22, 2021 01:43
sample of script to retrieve routes in a Fast API app
from collections import namedtuple
from typing import List, Set
from fastapi import FastAPI
from fastapi.routing import APIRoute
from starlette.routing import BaseRoute
KOIIRoutes = List[BaseRoute]
Path = namedtuple("Path", ["path", "method"])
@BolajiOlajide
BolajiOlajide / fetch-wrapper.js
Created April 20, 2021 15:03
a wrapper around fetch for Asincole
const fetch = require('node-fetch');
const http = require('http');
const https = require('https');
const httpAgent = new http.Agent({ keepAlive: true });
const httpsAgent = new https.Agent({ keepAlive: true });
const agent = (parsedUrl) => parsedUrl.protocol == 'http:' ? httpAgent : httpsAgent;
const client = {
async _createClient(method, url, payload = null, headers = {}) {
@BolajiOlajide
BolajiOlajide / git-fu.txt
Created April 19, 2021 22:29
some cool git tricks
git blame file_name
git show commit_sha
git log -S "word/phrase to search for occurence" --reverse (get it in reverse order)
git push --force-with-lease # fail if someone pushed something to the same branch before this is about to happen
git config --global commit.verbose true # include the commit history when commiting stuff
git config --global core.editor "code"