Skip to content

Instantly share code, notes, and snippets.

View indapublic's full-sized avatar
🏠
Working from home

Vasilii indapublic

🏠
Working from home
View GitHub Profile
@neretin-trike
neretin-trike / pug.md
Last active April 29, 2025 08:20
Туториал по HTML препроцессору Pug (Jade)
@danielkcz
danielkcz / formik-mobx.js
Last active July 26, 2023 21:51
Formik with MobX
function useFormik(props) {
// useState to keep the same observable around without recreating it on each render
const [formik] = React.useState(() =>
mobx.observable({
values: props.initialValues || {},
touched: {}
})
)
// just mutate state, this function itself can be considered an action+reducer
@vovkasm
vovkasm / KeyboardDismisser.tsx
Last active March 29, 2019 22:31
How to hide keyboard by click outside text field withotu ScrollView
// tslint:disable:object-literal-sort-keys
import React from 'react'
import { GestureResponderEvent, LayoutRectangle, NativeTouchEvent, UIManager } from 'react-native'
// HACK
import { blurTextInput, currentlyFocusedField, isTextInput } from 'App/lib/extendedTextState'
/**
* Touchable states.
@epicbytes
epicbytes / example.api.ts
Last active January 20, 2025 20:45
NextJS Authorization Files
/*** function that used as middleware ***/
accessToken: async (name) => {
if (typeof document === "undefined") return "";
let token = document.cookie
.split(";")
.filter((cookie) => cookie.startsWith("token"))[0];
if (!token) {
const response = await fetch("/api/refresh", { method: "POST" });