Skip to content

Instantly share code, notes, and snippets.

View kitze's full-sized avatar
🚀
Solving problems

Kitze kitze

🚀
Solving problems
View GitHub Profile
@kitze
kitze / paddle.ts
Created April 16, 2021 17:39
paddle thingie
//methods
import { BaseSchemaThingie, RawPaddleEvent } from "app/core/paddle/types";
import { filterWebookEvents } from "app/core/paddle/utils/filter-webook-events";
import axios, { AxiosResponse } from "axios";
import { GetPayments } from "./types/getPayments";
import { Schema as GetSubscriptionDetails } from "app/core/paddle/sdk/requests/getSubscriptionDetails/type";
import { GetWebhookEvents, PaddleClientConfig, PaddleRequest } from "./types/types";
@kitze
kitze / coda-favicon.js
Created June 2, 2022 11:10
A TamperMonkey script that will set the favicon of the page to the page icon of coda
// ==UserScript==
// @name Change coda favicon
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Kitze
// @match https://coda.io/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@kitze
kitze / store-wrapper.js
Last active April 28, 2022 13:45
mobx store wrapper for storybook
import React from 'react';
import {Provider} from 'mobx-react';
const stub = () => true;
export const exampleStore = {
app: {},
auth: {
checkAuth: stub
},
@kitze
kitze / plopfile.js
Created May 25, 2016 10:41
A sample plopfile for generating React components and components with containers
module.exports = function (plop) {
/* Helpers */
plop.addHelper('upperCase', function (text) {
return text.toUpperCase();
});
/* Files */
var createIndex = {
type: 'add',
@kitze
kitze / not-wordle.tsx
Created February 1, 2022 19:34
rectangles
const Rectangles = ({
cols,
defaultBackground,
defaultBackgroundEmoji,
paints,
rows,
paint
}) => {
return (
<L.Vertical>
@kitze
kitze / store.js
Created January 24, 2018 13:14
simplified redux
import produce from 'immer';
import {createStore} from 'redux';
const handleActions = (actionsMap, defaultState) => (
state = defaultState,
{type, payload}
) =>
produce(state, draft => {
const action = actionsMap[type];
action && action(draft, payload);
{
"oneOf": [
{
"type": "object",
"description": "Success response",
"properties": {
"success": {
"type": "boolean"
},
"response": {
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export type Schema =
| {
success?: boolean;
@kitze
kitze / manager.tsx
Created April 15, 2021 19:31
chakra-alert-manager
import { useDisclosure } from "@chakra-ui/react";
import ConfirmDialog from "app/core/chakra-prompts/ConfirmDialog";
import FormPrompt from "app/core/chakra-prompts/FormPrompt";
import React, { useContext, useState } from "react";
const ChakraPromptsContext = React.createContext<any>(null);
export const useChakraPrompts = () => useContext(ChakraPromptsContext);
const Manager = ({ children }) => {
const [config, setConfig] = useState<any>({});
@kitze
kitze / Meta.tsx
Created November 18, 2020 09:57
Meta component for Next.js
import Head from 'next/head';
import React from 'react';
import { isDev } from 'utils/is-prod';
const prefix = isDev ? 'http://localhost:3004' : 'https://kitze.io';
const getImage = (url) => `${prefix}/${url}`;
const Meta: React.FC<{
title?: string;