Skip to content

Instantly share code, notes, and snippets.

View victor-enogwe's full-sized avatar

Victor Enogwe victor-enogwe

View GitHub Profile
@victor-enogwe
victor-enogwe / Git_Commit_Freeze_Solution.md
Created December 11, 2024 13:01 — forked from bahadiraraz/Git_Commit_Freeze_Solution.md
Git Commit Freeze Due to GPG Lock Issues (Solution)

Git Commit Freeze Due to GPG Lock Issues

If you encounter a problem where you cannot commit changes in Git – neither through the terminal nor via the GitHub Desktop application – the issue might be a freeze during the Git commit process. This is often caused by GPG lock issues. Below is a concise and step-by-step guide to resolve this problem.

Solution Steps

1. Check for GPG Lock Messages

Open your terminal and try to perform a GPG operation (like signing a test message). If you see repeated messages like gpg: waiting for lock (held by [process_id]) ..., it indicates a lock issue.

@victor-enogwe
victor-enogwe / fastify-multer.module.ts
Last active September 2, 2024 00:10
Nestjs fastify multer module
import { DynamicModule, Module, OnApplicationBootstrap } from '@nestjs/common';
import { HttpAdapterHost } from '@nestjs/core';
import {
MulterModule,
MulterModuleAsyncOptions,
MulterModuleOptions,
} from '@nestjs/platform-express';
import { FastifyAdapter } from '@nestjs/platform-fastify';
import {
FastifyInstance,
@victor-enogwe
victor-enogwe / README.md
Last active October 27, 2021 05:13
Angular SSR DJango

Angular SSR rendering for python Apps.

... Leave a question if you've got one.

@victor-enogwe
victor-enogwe / helmet.interceptor.ts
Last active July 26, 2020 10:14
Loopback-next Helmet interceptor.
import { globalInterceptor, inject, Interceptor, InvocationContext, InvocationResult, Provider, ValueOrPromise, ContextTags } from '@loopback/context'
import { Request, Response, RestBindings } from '@loopback/rest'
import helmet from 'helmet'
/**
* This class will be bound to the application as an `Interceptor` during
* `boot`
*/
@globalInterceptor('', { tags: { name: 'helmet', [ContextTags.GLOBAL_INTERCEPTOR_SOURCE]: 'route' } })
export class HelmetInterceptor implements Provider<Interceptor> {
@victor-enogwe
victor-enogwe / settings.json
Created February 16, 2020 20:48
my VSCODE typescript project settings
{
"git.ignoreLimitWarning": true,
"standard.autoFixOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll.tslint": true
},
"typescript.tsdk": "node_modules/typescript/lib"
}
@victor-enogwe
victor-enogwe / tasks.json
Created February 16, 2020 16:29
Typescript debugger task config for VSCODE. Put this in the .vscode folder
{
"version": "2.0.0",
"tasks": [
{
"label": "tsc-watch",
"command": "npm",
"args": [ "run", "watch" ],
"type":"shell",
"isBackground": true,
"group":"build",
@victor-enogwe
victor-enogwe / README.md
Created February 16, 2020 12:21 — forked from BoGnY/README.md
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@victor-enogwe
victor-enogwe / EmailOrUsernameModelBackend.py
Last active January 30, 2020 15:42
Django Custom Model Backend - Enables Auth With Emails or Usernames
from django.contrib.auth.backends import ModelBackend, get_user_model
class EmailOrUsernameModelBackend(ModelBackend):
'''This is a ModelBacked that allows authentication with either a username or an email address.'''
def authenticate(self, request, username=None, password=None, **kwargs):
if username is None:
username = kwargs.get(get_user_model().USERNAME_FIELD)
if password is None:
password = kwargs.get(get_user_model().PASSWORD_FIELD)
// function to list scripts and styles registered at certain points in Wordpress
function list_scripts_styles() {
global $wp_scripts, $wp_styles;
echo "registered scripts\n";
foreach ($wp_scripts->queue as $handle) {
echo $handle . ' | ' . $wp_scripts->registered[$handle]->src . "\n";
}
echo "registered styles\n";
@victor-enogwe
victor-enogwe / restapi.txt
Created September 5, 2019 06:06 — forked from chrismccoy/restapi.txt
WordPress REST API Resources
Allow ALL cross origin requests to WordPress REST API
https://github.com/Shelob9/rest-all-cors
WordPress theme using Rest API and Vue.js
https://github.com/rtCamp/VueTheme
WordPress Post from Front End using REST API and Vue.js
http://jimfrenette.com/2017/01/post-from-front-end-wp-api-vuejs/
An offline-first SPA using Vue.js, the WordPress REST API and Progressive Web Apps