Skip to content

Instantly share code, notes, and snippets.

conquering challenges with code

Dhruv Patel dhruv-m-patel

conquering challenges with code
View GitHub Profile
dhruv-m-patel /
Last active Mar 28, 2022
Understanding Apollo GraphQL (Full stack edition)

Apollo GraphQL

  • Apollo GrpahQL allows a simplified way of building a server with GraphQL. It also allows you do the data binding in various technical stacks using Apollo packages on client side applications.
  • GraphQL follows schema first design requiring to think of data in terms of graphs
  • In a graph, nodes represent objects, where as arrows (edges) represent relationships

Part 1: Basics of full-stack development with Apollo GraphQL

GraphQL Schema:

View jscodesamples.js
// What would be the outcome of this statement?
const [a, b] = [10, 20];
dhruv-m-patel / react-globals.code-snippets
Created Sep 24, 2020
React Globals Code Snippet for VS Code
View react-globals.code-snippets
"New Component Boilerplate": {
"prefix": "component",
"body": [
"import React from 'react';",
"import PropTypes from 'prop-types';",
"import styles from './$1.module.$2css';",
"export default function $1({ $2 }) {",
" return (",
dhruv-m-patel /
Last active Apr 21, 2019
macOS Mojave VSCode Font fix

Command to run to fix font blur in VSCode after upgrading to macOS Mojave

defaults write CGFontRenderingFontSmoothingDisabled -bool NO
dhruv-m-patel /
Last active Dec 20, 2017
Squash commits, split them and make it a story

Say you have 12 commits on a few files for a branch that has not been reviewed yet

Here is a way to make it look like a better, cleaner story:

Step1: Squash commits into single commit

$ git rebase -i HEAD~12 #number of commits you have on your branch
# In editor window, replace all `pick` options for commits with `squash` or `s`
# Hit escape and write `:wq` and hit enter
dhruv-m-patel / .gitconfig
Last active Apr 5, 2022
Useful Git aliases
View .gitconfig
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
default = current
a = add
cm = commit -m
co = checkout

Keybase proof

I hereby claim:

  • I am dhruv-m-patel on github.
  • I am dhruvpatel ( on keybase.
  • I have a public key ASDtrCjDw_Vrkxb4AJDkqGGXuETidn76EHCUDiL-IuUE5wo

To claim this, I am signing this object:

dhruv-m-patel / WebStorage.js
Last active Feb 22, 2017
Web Storage with cache expiration
View WebStorage.js
// Generic abstraction of web storage operations available for local and session storage
function Storage(storage) {
this.moment = require('moment'); = storage;
Storage.prototype = {
cache: function(key, value, ttl) {
if(!value || ! {
dhruv-m-patel / jquery.simplePagination.bootstrap.css
Created Oct 28, 2016
Bootstrap v3 style for jquery.simplePagination.js plugin
View jquery.simplePagination.bootstrap.css
.simple-pagination {
display: inline-block;
padding-left: 0;
margin-top: 1rem;
margin-bottom: 1rem;
border-radius: .25rem;
.simple-pagination li {
display: inline;