Skip to content

Instantly share code, notes, and snippets.

View bluebeel's full-sized avatar

Saïkou Barry bluebeel

View GitHub Profile
@bluebeel
bluebeel / README.md
Created October 13, 2021 15:46 — forked from benknight/README.md
[use-carousel] Headless UI React hook for building a scroll-based carousel

[use-carousel] Headless UI React hook for building a scroll-based carousel

BYO-UI. No CSS necessary. Inspired by react-table.

Usage:

const {
  getLeftNavProps,
 getRightNavProps,
@bluebeel
bluebeel / readme.md
Created June 30, 2021 18:14 — forked from slava-vishnyakov/readme.md
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@bluebeel
bluebeel / index.tsx
Created July 26, 2020 14:11
autocomplete algolia antd
import { AutoComplete } from 'antd';
import { AutoCompleteProps } from 'antd/lib/auto-complete';
import { Ref, useState } from 'react';
import React from 'react';
import useAutocomplete from '@/components/autocomplete/hook';
export default React.forwardRef((props: AutoCompleteProps, ref: Ref<AutoComplete>) => {
const [search, setSearch] = useState<string>('');
curl 'https://www.seloger.com/annoncesbff/3/PointOfInterest' \
-H 'authority: www.seloger.com' \
-H 'cache-control: max-age=0' \
-H 'dnt: 1' \
-H 'content-type: application/json' \
-H 'accept: */*' \
-H 'origin: https://www.seloger.com' \
-H 'sec-fetch-site: same-origin' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
@bluebeel
bluebeel / Final Tailwind UI Transition.tsx
Last active August 4, 2021 01:23 — forked from stevecastaneda/ModalExample.tsx
Modified Transition React Component to Support Nested Transitions - Typescript
// JSX Version by Adam Wathan: https://gist.github.com/adamwathan/e0a791aa0419098a7ece70028b2e641e
import React, { ReactNode } from "react";
import { CSSTransition as ReactCSSTransition } from "react-transition-group";
import { useRef, useEffect, useContext } from "react";
interface TransitionProps {
show?: boolean;
enter?: string;
enterFrom?: string;
@bluebeel
bluebeel / useTheme2.tsx
Created April 25, 2020 20:16 — forked from timc1/useTheme2.tsx
🌑☀️core app system/light/dark mode theming + varying themes for nested components
import * as React from "react";
type ThemeConfig = "system" | "light" | "dark";
type ThemeName = "light" | "dark";
// Custom themes are keyed by a unique id.
type KeyedThemes = {
[k: string]: {
config: ThemeConfig;
themeName: ThemeName;
};
@bluebeel
bluebeel / App.js
Created March 22, 2020 16:42 — forked from gvdonovan/App.js
TW UI Application Shell - React
import React, { Component } from "react";
import UserProfileMenu from "./UserProfileMenu";
function classNames(...classes) { return classes.filter(Boolean).join(" "); }
class App extends Component {
constructor(props) {
super(props);
this.state = { isToggleOn: false };
}
# Base build image
FROM golang:latest as build-env
# All these steps will be cached
RUN mkdir /api
WORKDIR /api
COPY go.mod .
COPY go.sum .
# Get dependancies - will also be cached if we won't change mod/sum
RUN go mod download
@bluebeel
bluebeel / docker-compose.yml
Created December 5, 2019 16:42
docker-swarm nats streaming cluster
version: '3.5'
services:
nats-1:
command:
- "-D"
- "-p"
- "4222"
- "-cluster"
- "nats://0.0.0.0:6222"
@bluebeel
bluebeel / dotted-map.markdown
Created September 21, 2019 19:01
Dotted map