Skip to content

Instantly share code, notes, and snippets.

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

Sviatoslav Bulbakha ssbb

🏠
Working from home
View GitHub Profile
#!/usr/bin/env python
import json
import os
import re
BASE_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)))
STATIC_DIR = os.path.join(BASE_DIR, '..', 'static')
@ssbb
ssbb / MyComponent.tsx
Last active November 5, 2022 21:06
Next.js graphql-request example
import { cache } from 'react';
import { graphqlClient } from "lib/graphql-client";
export const myFetch = cache(async () => {
const { myDocument } = await graphqlClient().request(myDocument, {});
});
! Theme: modus-vivendi-tritanopia
! Description: XTerm port of modus-vivendi-tritanopia (Modus themes for Emacs)
! Author: Protesilaos Stavrou, <https://protesilaos.com>
xterm*background: #000000
xterm*foreground: #ffffff
xterm*color0: #000000
xterm*color1: #ff5f59
xterm*color2: #44bc44
xterm*color3: #cabf00
xterm*color4: #2fafff
defmodule MyApp.Snippet do
defmacro defsnippet(name, do: snippet) do
quote do
snippets = Module.get_attribute(__MODULE__, :snippets) || []
snippets = [{unquote(name), unquote(snippet)} | snippets]
Module.put_attribute(__MODULE__, :snippets, snippets)
end
end