Skip to content

Instantly share code, notes, and snippets.

View iamonuwa's full-sized avatar
💭
Learning 🦀

Onuwa Nnachi Isaac iamonuwa

💭
Learning 🦀
View GitHub Profile
@anchan828
anchan828 / README.md
Last active May 1, 2024 04:26
This is an improvement to allow @nestjs/typeorm@8.1.x to handle CustomRepository. I won't explain it specifically, but it will help in some way. https://github.com/nestjs/typeorm/pull/1233

You need to provide some classes and decorators yourself to maintain the same style as typeorm@2.x.

1. EntityRepository -> CustomRepository

@EntityRepository(UserEntity)
export class UserRepository extends Repository<UserEntity> {}

@palewire
palewire / README.md
Last active April 15, 2024 20:38
How to push tagged Docker releases to Google Artifact Registry with a GitHub Action

How to push tagged Docker releases to Google Artifact Registry with a GitHub Action

Here's how I configured a GitHub Action so that a new version issued by GitHub's release interface will build a Dockerfile, tag it with the version number and upload it to Google Artifact Registry.

Before you attempt the steps below, you need the following:

  • A GitHub repository that contains a working Dockerfile
  • The Google Cloud SDK tool gcloud installed and authenticated

Create a Workload Identity Federation

@Luccasoli
Luccasoli / useReactNavigationQuery
Created May 14, 2021 23:44
useQuery layer implementing refetchOnWindowFocus in react-native project using react-navigation
import { useFocusEffect } from '@react-navigation/core';
import { useCallback } from 'react';
import {
QueryFunction,
QueryKey,
useQuery,
UseQueryOptions,
UseQueryResult,
} from 'react-query';
@nathanhleung
nathanhleung / FIX-MACOS-HANG.md
Last active February 24, 2024 08:25
Fix macOS Hanging Issue

Fix macOS Hanging Issue

Problem

Hey Apple users:

If you're now experiencing hangs launching apps on the Mac, I figured out the problem using Little Snitch.

It's trustd connecting to http://ocsp.apple.com >

@nhudinhtuan
nhudinhtuan / cheat_sheet.md
Last active February 13, 2024 15:44
15 days cheat sheet for interviews
@sandeepsuvit
sandeepsuvit / interfaces.mongo-options.interface.ts
Created January 13, 2020 08:23 — forked from AliYusuf95/interfaces.mongo-options.interface.ts
MongoDB driver module for NestJS with dynamic mongo connection creation per request and handling open connections
import { ModuleMetadata, Type } from '@nestjs/common/interfaces'
/**
* Options that ultimately need to be provided to create a MongoDB connection
*/
export interface MongoModuleOptions {
connectionName?: string
uri: string
dbName: string
clientOptions?: any
@AliYusuf95
AliYusuf95 / interfaces.mongo-options.interface.ts
Created September 8, 2019 14:02
MongoDB driver module for NestJS with dynamic mongo connection creation per request and handling open connections
import { ModuleMetadata, Type } from '@nestjs/common/interfaces'
/**
* Options that ultimately need to be provided to create a MongoDB connection
*/
export interface MongoModuleOptions {
connectionName?: string
uri: string
dbName: string
clientOptions?: any
@Nikolaj-K
Nikolaj-K / imusify_reward_model_v2.py
Created February 14, 2018 01:32
imusify reward model 2.0 dummy reference implementation
import math
ICO_SUPPLY = 10**9
DECIMALS = 8
FLOAT_FACTOR = 10**DECIMALS
IMUSIFY_OPERATION_STACK = (3-1) * ICO_SUPPLY * FLOAT_FACTOR
SOME_USER_ADDRESS = 'ASsudg...poor soul'
IMUSIFY_MAIN_IMU_ADDRESS = "AXjsdb...much IMU here"
IMUSIFY_OPERATION_IMU_ADDRESS = "AKjsdb...less IMU here"
@ckimrie
ckimrie / example.component.ts
Last active December 12, 2023 20:53
Example on how to achieve RxJS observable caching and storage in Angular 2+. Ideal for storing Http requests client side for offline usage.
import { Component, OnInit, OnDestroy } from '@angular/core';
import {Http} from "@angular/http";
import { LocalCacheService } from "./local-cache.service";
@Component({
selector: 'app-example',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class ExampleComponent implements OnInit, OnDestroy {
@odigity
odigity / Firebase Database API Cheatsheet
Last active June 9, 2022 03:45
Firebase Database API Cheatsheet
There is no way to store an empty object/array/null value.
There are also no actual arrays. Array values get stored as objects with integer keys.
(If all keys are integers, it will be returned as an array.)
Basically, it's one giant tree of hashes with string keys.
Simply write a value to any location, and the intermediary locations will automatically come into existance.
── Classes ──
DataSnapshot : Container for a subtree of data at a particular location.