Skip to content

Instantly share code, notes, and snippets.

View bluebeel's full-sized avatar

Saïkou Barry bluebeel

View GitHub Profile
@bluebeel
bluebeel / index.html
Created February 23, 2019 14:33
Upload Form
<section class="upload-file">
<h1 class="heading">Upload files</h1>
<p class="paragraph">You can upload multiple files.</p>
<div class="files hidden" data-files></div>
<form class="form" enctype="multipart/formdata">
<div class="dropzone" data-dropzone>
<div class="dropzone__field">
<label class="dropzone__label" for="files" data-dropzone-label>Upload files</label>
<input class="dropzone__file" id="files" name="files" type="file" multiple data-dropzone-file>
</div>
const stripe = require('stripe')('secret-code-here')
const micro = require("micro");
const isPost = (req) => {
if (!isPostRequest(req)) {
throw micro.createError(400, "POST request is required");
}
return micro.json(req);
};
const isPostRequest = (req) => {
@bluebeel
bluebeel / dotted-map.markdown
Created September 21, 2019 19:01
Dotted map
@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"
# 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 / 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 };
}
@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 / 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;
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 / 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>('');