Skip to content

Instantly share code, notes, and snippets.

View smitpatelx's full-sized avatar
🎯
Focusing

Smit Patel smitpatelx

🎯
Focusing
View GitHub Profile
@smitpatelx
smitpatelx / FocusOutside.jsx
Created January 11, 2021 20:38
Wrapper for catching blur and click outside event. Useful while building dropdowns and many more!
import { useState } from "react";
const FocusOutside = ({clickedOutside, ...props})=>{
let _timeoutID;
const [IsManagingFocus, setIsManagingFocus] = useState(false);
const _onBlur = ()=>{
_timeoutID = setTimeout(() => {
@smitpatelx
smitpatelx / Educational OR Learning.md
Last active May 10, 2019 22:37
A mint of creativity
@ghinda
ghinda / object-to-form-data.js
Last active May 21, 2024 20:48
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active June 24, 2024 19:36
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k