Skip to content

Instantly share code, notes, and snippets.

View rotimi-best's full-sized avatar
👨‍💻
Inventing the future

Rotimi Best rotimi-best

👨‍💻
Inventing the future
View GitHub Profile
@rotimi-best
rotimi-best / DockerfileForSvelteKit.md
Created September 18, 2024 15:31 — forked from aradalvand/DockerfileForSvelteKit.md
Dockerfile and .dockerignore for SvelteKit:

*This Dockerfile is intended for SvelteKit applications that use adapter-node. So, the Dockerfile below assumes that you have already installed and configured the adapter.

Dockerfile:

FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
@rotimi-best
rotimi-best / sql
Last active June 7, 2024 17:39
get_explore_courses.sql
drop function if exists public.get_explore_courses (uuid, uuid);
create
or replace function public.get_explore_courses (org_id_arg uuid, profile_id_arg uuid) returns table (
id uuid,
org_id uuid,
title character varying,
slug character varying,
description character varying,
@rotimi-best
rotimi-best / load_setup.ts
Created April 2, 2024 11:32
Load function for TS file of /setup page
import get from 'lodash/get';
async function getGenericData(orgSlug: string): Promise<{ isCoursePublished: boolean; isCourseCreated: boolean; orgHasAvatarUrl: boolean}> {
const { data } = await supabase.from('course').select(`
id,
is_published,
group:group_id!inner(
organization!inner (
avatar_url,
siteName
@rotimi-best
rotimi-best / create_service_cache.sh
Last active October 31, 2023 07:45
Script that generates a cache.ts file for any service
#!/bin/bash
# Service name for the TypeScript file.
service_name="$1"
file_name="cache.ts"
# Code content to write to the file.
code="import { revalidateTag } from \"next/cache\";
interface RevalidateProps {
@rotimi-best
rotimi-best / .svelte
Created October 20, 2023 16:36
Horizontal Scroll of Students
<script>
let name = 'world';
const students = [
{ avatarUrl: 'https://images.unsplash.com/photo-1599566150163-29194dcaad36?auto=format&fit=crop&q=60&w=800&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NHx8YXZhdGFyc3xlbnwwfHwwfHx8Mg%3D%3D', name: 'Ifeanyi' },
{ avatarUrl: 'https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?auto=format&fit=crop&q=60&w=800&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8OHx8YXZhdGFyc3xlbnwwfHwwfHx8Mg%3D%3D', name: 'John' },
{ avatarUrl: '', name: 'Tunji' },
{ avatarUrl: '', name: 'Trump' },
{ avatarUrl: '', name: 'Buhari' },
]
@rotimi-best
rotimi-best / git.md
Created September 30, 2021 09:34
How we work using Git

Git commands

0. Создание / клонирование / добавление репозитория

Клонирование ропозитория:

hg clone https://[email protected]/someRepo/projectName

Инициализация локального репозитория:

@rotimi-best
rotimi-best / index.html
Created June 2, 2021 13:29
Questionnaire Builder
<div id="root"></div>
@rotimi-best
rotimi-best / react-folder-structure.md
Last active April 8, 2021 02:18
An opinionated folder structure for my react applications
root/
├── __test__/
├── public/
├── .storybook/
│   ├──stories/
│   │   ├── NextButton/
│   │   │   └── NextButton.stories.js
│   │   └── RadioButton/
@rotimi-best
rotimi-best / fetch.js
Created December 21, 2020 16:59
Basic fetch request
fetch('https://httpbin.org/post', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({a: 1, b: 'Textual content'})
});
@rotimi-best
rotimi-best / maxima.md
Last active December 20, 2020 01:34
Installation process of maxima on Ubuntu (tested on 16.04)

Steps to install maxima

  1. Run if already installed previous. sudo apt-get --purge remove maxima I was getting this error below cause I already had it some how installed. I can't remember how I initially installed it.
Setting up maxima (5.44.0-2) ...
chown: invalid user: ‘vttoth:vttoth’
chown: invalid user: ‘vttoth:vttoth’
dpkg: error processing package maxima (--configure):