Skip to content

Instantly share code, notes, and snippets.

View minhazfm's full-sized avatar

Minhaz Mohammad minhazfm

View GitHub Profile
@rphlmr
rphlmr / index.ts
Last active April 13, 2025 14:59
Link XState and Remix fetcher
import type { ActionFunctionArgs, LoaderFunctionArgs } from '@remix-run/node';
import {
ClientActionFunctionArgs,
ClientLoaderFunctionArgs,
useFetcher,
useLoaderData,
} from '@remix-run/react';
import { enqueueActions, fromPromise, setup } from 'xstate';
import { useActor } from '@xstate/react';
import { useEffect, useRef } from 'react';
@adamkl
adamkl / AppContextProvider.tsx
Created February 10, 2020 22:20
xState service layer
import React from "react";
import { createUserSessionService } from "services/UserSessionService";
import { createNavService } from "services/NavService";
// Wiring up our "IOC container"
const userSessionService = createUserSessionService();
// NavService depends on UserSessionService
const navService = createNavService(userSessionService);
@yinzara
yinzara / github_bitbucket_multiple_ssh_keys.md
Last active January 21, 2026 12:14
Managing SSH keys and repo cloning using multiple accounts on GitHub and BitBucket

Why Multiple SSH keys?

There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket

You may use the same computer for work and personal development and need to separate your work.

When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.

You may have different projects you're working on where you would like to segregate your access.

@Godofbrowser
Godofbrowser / axios.refresh_token.1.js
Last active November 30, 2025 18:30 — forked from culttm/axios.refresh_token.js
Axios interceptor for refresh token when you have multiple parallel requests. Demo implementation: https://github.com/Godofbrowser/axios-refresh-multiple-request
// for multiple requests
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
failedQueue.forEach(prom => {
if (error) {
prom.reject(error);
} else {
prom.resolve(token);
@matthewzring
matthewzring / markdown-text-101.md
Last active March 14, 2026 06:06
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

//
// SignupViewController.swift
// TestApp
//
// Created by Abhilash on 25/02/17.
//
import UIKit
class SignupViewController: UIViewController, UITextFieldDelegate {
@kharrison
kharrison / CoreDataController.swift
Last active January 31, 2023 22:36
Swift wrapper for NSPersistentContainer - Easy Core Data Setup with iOS 10
//
// CoreDataController.swift
//
// Created by Keith Harrison http://useyourloaf.com
// Copyright (c) 2017 Keith Harrison. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright
@hgsan
hgsan / ScrollViewAndPageControlViewContoller.swift
Last active May 16, 2019 05:29
manage UIPageControl and UIScrollView with RxSwift
@IBOutlet weak var pageControll: UIPageControl!
@IBOutlet weak var scrollView: UIScrollView!
var scrollViewPageIndex :Int {
set {
let contentX = scrollView.width * CGFloat(newValue)
DispatchQueue.main.async {
UIView.animate(withDuration: 0.2, animations: { [weak self] _ in
self?.scrollView.contentOffset = CGPoint.init(x: contentX, y: 0)
})
@mjul
mjul / aws_env
Created July 8, 2016 13:32
Get environment variables from AWS profile (for use with docker-machine)
#!/bin/sh
# Set the AWS environment variables for an AWS profile
# Useful for docker-machine
#
# Example:
#
# aws_env profile-for-testing
#
# Further information:
# See the AWS CLI `aws configure`