Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dhruv-m-patel's full-sized avatar
🍁
conquering challenges with code

Dhruv Patel dhruv-m-patel

🍁
conquering challenges with code
View GitHub Profile
@dhruv-m-patel
dhruv-m-patel / apollo-graphql.md
Last active March 28, 2022 01:57
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:

@dhruv-m-patel
dhruv-m-patel / jscodesamples.js
Last active March 17, 2021 03:14
JS Code Samples
// What would be the outcome of this statement?
const [a, b] = [10, 20];
@dhruv-m-patel
dhruv-m-patel / react-globals.code-snippets
Created September 24, 2020 19:35
React Globals Code Snippet for VS Code
{
"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
dhruv-m-patel / vscode-fix.md
Last active April 21, 2019 04:30
macOS Mojave VSCode Font fix

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

defaults write com.microsoft.VSCode.helper CGFontRenderingFontSmoothingDisabled -bool NO
@dhruv-m-patel
dhruv-m-patel / squash-split-commits.md
Last active December 20, 2017 15:45
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
dhruv-m-patel / .gitconfig
Last active April 5, 2022 16:59
Useful Git aliases
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
[push]
default = current
[alias]
a = add
cm = commit -m
co = checkout
@dhruv-m-patel
dhruv-m-patel / keybase.md
Created August 3, 2017 16:08
keybase.md

Keybase proof

I hereby claim:

  • I am dhruv-m-patel on github.
  • I am dhruvpatel (https://keybase.io/dhruvpatel) on keybase.
  • I have a public key ASDtrCjDw_Vrkxb4AJDkqGGXuETidn76EHCUDiL-IuUE5wo

To claim this, I am signing this object:

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