Skip to content

Instantly share code, notes, and snippets.

View mzohaibqc's full-sized avatar
💭
React is first love 💖 but Vue is awesome 🔥

Zohaib Ijaz mzohaibqc

💭
React is first love 💖 but Vue is awesome 🔥
View GitHub Profile
@southpolesteve
southpolesteve / thoughts.md
Last active March 19, 2021 23:42
Random GraphQL+RDBMS+AWS Lambda Thoughts
  • GraphQL is awesome. I was not a fan at first, but I have since been converted. I wouldn't hesitate to use it for anything new. Its not perfect though.
  • Running on Lambda is pretty straight forward. We have our own custom code for that, but if I was starting fresh, I would use the Apollo GraphQL server. They have one that is designed to run on Lambda. I've played with it and it works well.
  • If your graphQL resolvers are talking directly to a DB, make sure to share connections between requests. One connection per lambda instance. If you spin up a new connection per request you will have a bad time. I guess this is generally true for not-graphql lambda things too.
  • You need dataloader. It will batch DB queries for you. It (or something like it) is pretty critical to making any graphQL setup performant. Or at least not overload your DB.
  • You proabably need to follow the Relay spec. We didn't d
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active April 10, 2024 16:40
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@leocristofani
leocristofani / RFReactSelect.js
Last active June 8, 2020 14:59
How to integrate React Select with Redux Form
import React, { PropTypes } from 'react';
import Select from 'react-select';
import 'react-select/dist/react-select.css';
RFReactSelect.defaultProps = {
multi: false,
className: ""
};
RFReactSelect.propTypes = {
@granmoe
granmoe / React Join Children
Last active December 7, 2022 14:50
Ever wanted to join react children like you join an array?
This file is only here to provide the title of the gist
/* index.css */
body{
background: #eee;
margin: 20px;
font-family: tahoma;
}
#todo-wrapper{
width: 80%;
@benjamincharity
benjamincharity / gitGrepDirectory.bash
Created February 26, 2016 16:19
Git grep within a specific sub-directory.
# Search for `analytics` only inside `./src/app`
git grep analytics -- "./src/app/*"
@parmentf
parmentf / GitCommitEmoji.md
Last active April 30, 2024 17:34
Git Commit message Emoji
@diosmosis
diosmosis / example.py
Created August 15, 2011 22:41
Python decorator that catches exceptions and logs a traceback that includes every local variable of each frame.
import os
from log_exceptions import log_exceptions
def throw_something(a1, a2):
raise Exception('Whoops!')
@log_exceptions(log_if = os.getenv('MYAPP_DEBUG') is not None)
def my_function(arg1, arg2):
throw_something(arg1 + 24, arg2 - 24)