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
@TimMikeladze
TimMikeladze / react-in-style.md
Last active April 11, 2016 17:59
How to React in style (pardon the pun)

The usage of React components in apps has become more popular over the last two years and rightly so. React provides a very structured paradigm for building the ui over your app, managing state and handling events. Although opinionated React doesn't make any assumptions towards how you go about styling your components yet it opens up some interesting avenues of thinking about CSS.

This talk will explore the some of different ways you can handle style in React, touching upon some of the following points.

  • The advantages of defining CSS as Javascript objects
  • CSS Modules
  • How do styled component libraries such as react-bootstrap and material-ui fit in to the mix?
  • Using preprocessors such as Sass
  • What to make of all this, which approach should you use when and why?
@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
@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.
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;
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'),
app.use('/graphql', graphqlExpress(async (req) => {
const userId = req.userId;
const user = await db.findUserById(userId)
return {
schema,
context: {
user
},
@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> = {
@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",
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,