Skip to content

Instantly share code, notes, and snippets.

View designdevy's full-sized avatar
🧪
experimenting

Muhammad Athar designdevy

🧪
experimenting
View GitHub Profile
/*
*
* Request Handlers
*
*/
// dependencies
const datalib = require('./data');
const helpers = require('./helpers');
/*
*
* Request Handlers
*
*/
// dependencies
const datalib = require('./data');
const helpers = require('./helpers');
@designdevy
designdevy / coffeelint.css
Created April 12, 2019 12:51 — forked from jspiro/coffeelint.css
coffeelint.org snapshot 9/19
* {
padding:0;
margin:0;
}
html {
width:100%;
}
body {
// GraphQL Shorthand Notation Cheatsheet
// - Read the full article at: https://wehavefaces.net/graphql-shorthand-notation-cheatsheet-17cd715861b6
Schema
=======
GraphQL Schema => schema
Built-in scalar types
import React, { useRef, useEffect } from 'react';
const ExternalScript = ({ src }) => {
const ref = useRef();
useEffect(() => {
const scriptEl = document.createElement("script");
scriptEl.src = src;
ref.current.append(scriptEl);
}, [src]);
import React from 'react';
const Hello = () => {
return (
<div>
<h1>Hello, Medium</h1>
{/* This doesn't work */}
<script src="//google.com/somescript.js"></script>
</div>
);
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
import _ from "lodash"
import React from "react";
import { useDispatch, useSelector } from "react-redux";
import { Firestore } from "@google-cloud/firestore";
const firestore = new Firestore();
interface Person extends Entity {
name: string;
hairColor: string;
import React from "react";
import { useDispatch, useSelector } from "react-redux";
import { Firestore } from "@google-cloud/firestore";
const firestore = new Firestore();
interface Person extends Entity {
name: string;
hairColor: string;
}
const firestore = new Firestore();
interface Person extends Entity {
name: string;
hairColor: string;
}
export const PersonComponent = ({ personId }: Record<"personId", string>) => {
const name = useSelector<any, any>(state => state.people[personId].name);
const hairColor = useSelector<any, any>(