Skip to content

Instantly share code, notes, and snippets.

Avatar
🍁
conquering challenges with code

Dhruv Patel dhruv-m-patel

🍁
conquering challenges with code
View GitHub Profile
@dhruv-m-patel
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;
}
@dhruv-m-patel
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');
this.store = storage;
}
Storage.prototype = {
cache: function(key, value, ttl) {
if(!value || !this.store) {
return;
}
View 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 / squash-split-commits.md
Last active Dec 20, 2017
Squash commits, split them and make it a story
View squash-split-commits.md

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 / vscode-fix.md
Last active Apr 21, 2019
macOS Mojave VSCode Font fix
View vscode-fix.md

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 / .gitconfig
Last active Sep 24, 2020
Useful Git aliases
View .gitconfig
[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 / 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 (",
View jscodesamples.js
// What would be the outcome of this statement?
const [a, b] = [10, 20];