Skip to content

Instantly share code, notes, and snippets.

@goququ
goququ / analytics
Last active July 11, 2023 10:40
analytics
{
"openapi": "3.0.1",
"info": {
"title": "ML.Analytics",
"version": "v1"
},
"paths": {
"/api/analytics/clients/{clientId}/instant": {
"get": {
"tags": [
@goququ
goququ / .editorconfig
Created November 23, 2022 18:20
My .editorconfig
root = true
[*.md]
trim_trailing_whitespace = false
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
@goququ
goququ / k8s.openapi.yaml
Created November 18, 2022 09:24
k8s.openapi.yaml
This file has been truncated, but you can view the full file.
definitions:
io.k8s.api.admissionregistration.v1.MutatingWebhook:
description: >-
MutatingWebhook describes an admission webhook and the resources and
operations it applies to.
properties:
admissionReviewVersions:
description: >-
AdmissionReviewVersions is an ordered list of preferred
`AdmissionReview` versions the Webhook expects. API server will try to
# Format staged js/ts files before commit
npx prettier --write $(git ls-files --modified -u | awk '{ print $4 }' | grep -E -i '.(t|j)sx?')
# variant 2
prettier --write $(git diff --name-only --cached | grep -E -i '.(t|j)sx?')
@goququ
goququ / indexes.js
Created October 12, 2021 10:04
Get next/previous index
const getNextIndex = (currentIndex, length) => (currentIndex + 1) % length;
const getPreviousIndex = (currentIndex, length) => (currentIndex - 1 + length) % length;
@goququ
goququ / utils.js
Created April 25, 2021 13:29
utils
const type = window.matchMedia("(min-width: 1025px)").matches ? 'desktop' : 'mobile';
// https://caniuse.com/#feat=getboundingclientrect
window.getBoundingClientRect()
@goququ
goququ / useInputCaret.ts
Created April 25, 2021 13:28
Sync input caret
import { useState, useRef, useEffect, useCallback } from 'react';
export function useCaretPosition<
T extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement
>() {
const node = useRef<T>(null);
const [start, setStart] = useState(0);
const [end, setEnd] = useState(0);
const updateCaret = useCallback(() => {
@goququ
goququ / web.js
Last active October 23, 2019 20:18
// https://windscribe.com/
(function() {
var width, height, largeHeader, canvas, ctx, points, target, animateHeader = true;
// Main
initHeader();
initAnimation();
addListeners();
Write
# sudo dd oflag=direct if=/home/qu/Downloads/manjaro-budgie-17.1.11-stable-x86_64.iso of=/dev/sdc1 bs=1M status=progress; sync
Flesh format
# sudo umount /dev/sdc1 && sudo mkfs.vfat /dev/sdc1
Programs for write image to flash
1) ETCHER
2) UNETBOOTIN