Skip to content

Instantly share code, notes, and snippets.

View Mr-emeka's full-sized avatar
👻
Ghost Mode

Ukpai Chukwuemeka Mr-emeka

👻
Ghost Mode
View GitHub Profile
@Mr-emeka
Mr-emeka / next-15-svgr-webpack-turbo.js
Last active January 3, 2025 13:45
Next.js 15 svg configuration with turbo
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
experimental: {
turbo: {
rules: {
'*.svg': {
loaders: ['@svgr/webpack'],
as: '*.js',
},
@Mr-emeka
Mr-emeka / jwt.js
Created December 26, 2024 12:34
How to Generate JWT Token in React Native
import Base64 from 'crypto-js/enc-base64';
import Utf8 from 'crypto-js/enc-utf8';
import HmacSHA256 from 'crypto-js/hmac-sha256';
export async function generateJWT(
header: any,
payload: any,
secret: string,
) {
// Step 1: Base64Url encode header and payload
@Mr-emeka
Mr-emeka / firebase.js
Last active March 1, 2023 23:02
Image Upload to firebase using queue
import { initializeApp } from "firebase/app";
// Optionally import the services that you want to use
// import {...} from "firebase/auth";
// import {...} from "firebase/database";
// import {...} from "firebase/firestore";
// import {...} from "firebase/functions";
import {
getStorage,
function simpleArraySum(ar) {
// Write your code here
let sum = 0;
ar.forEach((a,index)=>{
sum += a;
})
return sum
}
@Mr-emeka
Mr-emeka / postgres-cheatsheet.md
Created July 20, 2019 12:22 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)