Skip to content

Instantly share code, notes, and snippets.

View akshay-nm's full-sized avatar
🏎️
Pace is good.

Akshay Kumar akshay-nm

🏎️
Pace is good.
View GitHub Profile
@akshay-nm
akshay-nm / gist.md
Last active August 16, 2024 09:26
Fibonacci heap

To implement the required operations (make_heap, insert, find_min, delete_min, and decrease_key) in a Fibonacci Heap in C++, I will guide you through each function step by step.

  1. Node Structure First, we need a Node structure to represent each element in the Fibonacci Heap:
struct Node {
    int key;
    int degree;
    bool marked;
    Node *parent;
@akshay-nm
akshay-nm / gist:a3742223c6f03b6be5fe0fdd3425d3ae
Created June 30, 2024 07:35
Unreal engine 5: android build failure log
Log started at 06/30/2024 12:45:16 (2024-06-30T07:15:16Z)
No config file at C:\ProgramData\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml
No config file at ~\AppData\Local\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml
No config file at ~\Documents\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml
Configuration will be read from:
~\AppData\Roaming\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml
Log file: ~\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_5.4\UBA-apartsmigrate-Android-Shipping_2.txt
Setting temp directory to '~\AppData\Local\Temp\UnrealBuildTool\6e23c306'
Registering build platform: UnrealBuildTool.AndroidPlatformFactory
@akshay-nm
akshay-nm / use-form-state-login-form-call.js
Created May 1, 2021 09:54
use-form-state login form call
const {
isValid: formIsValid,
isValidating,
resetForm,
email,
showEmailWarning,
onEmailChange,
password,
showPasswordWarning,
onPasswordChange
@akshay-nm
akshay-nm / use-form-state-returns.js
Created May 1, 2021 09:51
Object returned by use-form-state
{
// form states and functions
isValid, // the overall form validity
isValidating, // are any validations still running
triggerValidation, // trigger validations
reset, // reset the form back to default configuration
// field wise states and functions
// for email
email,
@akshay-nm
akshay-nm / use-form-state-configuration-object.js
Last active May 1, 2021 09:43
use-form-state configuration for a login form
const config = {
states: [
{
name: 'email',
default: '',
defaultIsValid: false,
mustBeValid: true,
validator: () => true
},
{
{
name: 'nameInCamelCase', // Although I have added a camelize check but still...
default: '', // the default value of field
defaultIsValid: false, // is the field valid by default
mustBeValid: true, // is the field mandatory
validator: (value) => true // the validator
}
@akshay-nm
akshay-nm / publish.yml
Last active April 5, 2021 19:12
Publish your Node.js package using yarn to npm and gpr with codecoverage to codecov (Github workflow file)
name: Node.js Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
@akshay-nm
akshay-nm / adapter-logic.js
Last active November 4, 2020 13:42
Example for raghav
// No alterations in stuff before this as it is already configured...
const api = () => {
return {
login: {
post: (email, password) => {
const formData = new FormData()
formData.append('email', email)
formData.append('password', password)
@akshay-nm
akshay-nm / machine.js
Last active September 1, 2020 10:24
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@akshay-nm
akshay-nm / states.md
Last active May 26, 2020 10:11
Image Reveal component animation states
States Cover attributes Image attributes
S0 { left: 0%, width: 0% } { opacity: 0, transform: scale(0.5) }
S1 { width: 100% } no change
S2 { width: 0%, left: 100% } { transform: scale(1), opacity: 1 }