Skip to content

Instantly share code, notes, and snippets.

View TimMikeladze's full-sized avatar
🚏
debugging life

Tim Mikeladze TimMikeladze

🚏
debugging life
View GitHub Profile
```ts
import AdmZip from 'adm-zip';
import { NextApiRequest, NextApiResponse } from 'next';
export default async function handler(
req: NextApiRequest,
res: NextApiResponse,
) {
const zip = new AdmZip();
import { getSession } from 'next-auth/react';
import { findUserByEmailOrName, getMatches } from '../../graphql/resolvers';
import { createObjectCsvStringifier as createCsvStringifier } from 'csv-writer';
import AdmZip from 'adm-zip';
import { NextApiRequest, NextApiResponse } from 'next';
import isDowntime from '../../util/isDowntime';
export default async function handler(
req: NextApiRequest,
res: NextApiResponse,
@TimMikeladze
TimMikeladze / comicpop-library.json
Last active January 4, 2023 07:46
The ComicPop Libib library transformed into JSON - https://www.libib.com/u/comicpop
[{
"title": "Acts of Vengeance: Marvel Universe",
"author": "",
"image": "https://d23tvywehq0xq.cloudfront.net/i72c1e74bbcfe6d28dac782c8912b4206c.jpg"
}, {
"title": "Atlantis Attacks",
"author": "",
"image": "https://d23tvywehq0xq.cloudfront.net/ykd882437984e3fa5b644d868662cef55d.jpg"
}, {
"title": "Avatar the Last Airbender",
@TimMikeladze
TimMikeladze / countries.ts
Last active July 13, 2022 14:15
List of all countries with two letter country codes, flag emojis, timezones, utc offsets and mobile codes. Ready for usage in a Typescript project.
export type Country = {
code: string;
flag: string;
mobileCode: string;
name: string;
timezone: string;
utc: string;
};
const countries: Record<string, Country> = {
app.use('/graphql', graphqlExpress(async (req) => {
const userId = req.userId;
const user = await db.findUserById(userId)
return {
schema,
context: {
user
},
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: './src/index.js',
target: 'node',
externals: [nodeExternals()],
devtool: 'eval-source-map',
output: {
path: path.join(__dirname, '/lib'),
const FORM_REGISTRY_KEY = Symbol.for('yaFormRegistry');
const globalSymbols = Object.getOwnPropertySymbols(global);
const hasSymbol = globalSymbols.indexOf(FORM_REGISTRY_KEY) > -1;
if (!hasSymbol) {
global[FORM_REGISTRY_KEY] = {
handlers: {},
add(name, handler) {
this.handlers[name] = handler;
@TimMikeladze
TimMikeladze / spec_template.md
Last active May 26, 2016 09:45
A technical specification template for describing a user facing systems such as web or mobile apps.
@TimMikeladze
TimMikeladze / 0_reuse_code.js
Created April 15, 2016 09:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console