Skip to content

Instantly share code, notes, and snippets.

View oseeshogun's full-sized avatar

Osée Masuaku oseeshogun

View GitHub Profile
@oseeshogun
oseeshogun / script.js
Created August 23, 2021 23:11
Three Js Point Cloud Experiment
(function() {
'use strict';
// 'To actually be able to display anything with Three.js, we need three things:
// A scene, a camera, and a renderer so we can render the scene with the camera.'
// - https://threejs.org/docs/#Manual/Introduction/Creating_a_scene
var scene, camera, renderer;
// I guess we need this stuff too
var container, HEIGHT,
## context.jsx
import { createContext } from "react";
const amosContext = createContext(0)
export { amosContext }
============================================================================================
"""
Translation of arb files for Flutter Applicaiton
"""
from google.cloud import translate_v2
import six
import glob
import os
import json
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'service_translation.json'
@oseeshogun
oseeshogun / library mysql.sql
Last active September 15, 2022 14:12
Exercice sur Mysql pour la création d'une base de données d'une bibliothèque.
use library;
create table author(
id int not null primary key auto_increment,
first_name varchar(255),
last_name varchar(45) not null,
biography text
) ENGINE = InnoDB;
create table publisher(
@oseeshogun
oseeshogun / middleware.js
Created October 5, 2022 07:59
Middleware for checking authenticated user
/**
Documentation firebade: https://firebase.google.com/docs/auth/admin/verify-id-tokens
dependences:
- firebase-admin
- express (Pour créer les apis)
assets:
- serviceAccount.json ( Firebase Console > Paramètres > Compte de Service )
*/
@oseeshogun
oseeshogun / hive_key.dart
Created March 9, 2023 10:35
Flutter Hive Key. A class for a better handling of hive database keys.
import 'package:hive_flutter/hive_flutter.dart';
class HiveKey<T, BoxType> {
HiveKey(this.key, {this.defaultValue, this.defaultBox});
final String key;
final T? defaultValue;
final Box<BoxType>? defaultBox;
T? value([Box? box]) {
@oseeshogun
oseeshogun / index.md
Created May 24, 2023 21:54
Nextjs getServerSideProps

Pour utiliser getServerSideProps avec Next.js et Apollo Client, vous devez suivre ces étapes :

Étape 1 : Configuration d'Apollo Client Assurez-vous d'avoir configuré Apollo Client correctement dans votre application Next.js. Vous devez créer une instance d'Apollo Client avec les informations de configuration appropriées, telles que l'URL du serveur GraphQL. Vous pouvez le faire dans un fichier séparé, par exemple apolloClient.js, comme ceci :

import { ApolloClient, InMemoryCache } from '@apollo/client';

const apolloClient = new ApolloClient({
@oseeshogun
oseeshogun / firebase-auth-error.json
Created September 4, 2023 13:02
Firebase Authentication Error Messages
{
"admin-restricted-operation": "This operation is restricted to administrators only.",
"app-not-authorized": "This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.",
"app-not-installed": "The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.",
"captcha-check-failed": "The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.",
"code-expired": "The SMS code has expired. Please re-send the verification code to try again.",
"cordova-not-ready": "Cordova framework is not ready.",
"cors-unsupported": "This browser is not supported.",
"credential-already-in-use": "This credential is already associated with a different user account.",
"custom-token-mismatch"
@oseeshogun
oseeshogun / main.yaml
Last active January 19, 2024 19:26
CI CD workflow with Docker and Github Action
name: Deploy to VPS
on:
push:
branches:
- main
jobs:
build_and_push: