Skip to content

Instantly share code, notes, and snippets.

View Siddharth11's full-sized avatar
💤

Siddharth Parmar Siddharth11

💤
View GitHub Profile
@Siddharth11
Siddharth11 / web_performance_checklist.md
Last active June 28, 2023 11:04
Web performance checklist

Why it’s important

Testing

  • PageSpeed Insights (website)
  • Setup Lighthouse in pull requests (article)
  • Lighthouse in DevTools (docs)
@Siddharth11
Siddharth11 / Stacked-diff-steps.md
Created September 23, 2021 09:34 — forked from Whoaa512/Stacked-diff-steps.md
Cheatsheet for the stacked diffs workflow in phabricator at Fictiv

stack diff steps

  1. Checkout & pull latest master
git checkout master && git pull --rebase origin master
  1. Cut branch from master
arc branch stacked_feature_1
  1. Make changes, add commits
@Siddharth11
Siddharth11 / gist:ba2ee81ab407e6d4c07c6bef5baee7ac
Created July 15, 2020 22:15 — forked from zackdever/gist:8701478
arc diff off another diff
taken directly from https://sites.google.com/a/khanacademy.org/forge/for-developers/code-review-policy/using-phabricator
Advanced topic: Dependent Phabricator reviews
Say you have an upstream called master, and a feature branch F1, and a second change that depends on F1, (call it F2).
git checkout master
git checkout -b F1
# work work
git commit -a
arc diff

set default host

arc set-config default <instance>

set default editor to vim

arc set-config editor "vim"
@Siddharth11
Siddharth11 / keybase.md
Created May 7, 2020 15:02
Keybase verification

Keybase proof

I hereby claim:

  • I am siddharth11 on github.
  • I am siddharth11 (https://keybase.io/siddharth11) on keybase.
  • I have a public key ASBW7f3VhEYo2S-pBXki4btM9PDgvPw57Oqs1-tcAuOIfwo

To claim this, I am signing this object:

@Siddharth11
Siddharth11 / EventEmitter.js
Last active March 4, 2020 15:02
EventEmitter with release feature
class EventEmitter {
constructor() {
this.events = {};
}
subscribe(event, callback) {
const clonedCbWithNewRef = (...params) => {
callback(...params);
};
@Siddharth11
Siddharth11 / Pause.js
Created December 7, 2018 22:01
Pause JS execution for x milliseconds
const pause = pauseTime => {
const initial = new Date().getTime();
const final = currentTime + pauseTime;
while (final >= new Date().getTime()) {}
}
@Siddharth11
Siddharth11 / AnimateDiv.js
Last active March 4, 2020 14:59
Animate div from left to right using pure JS. Based on BDC's raf snippet: https://gist.github.com/bendc/aac89c40d88385d8f448fc4f4aee9f4a
// duration in milliseconds
// distance in px
const animate = (element, duration, distance) => {
const time = {
start: performance.now(),
elapsed: 0,
total: duration,
}
const move = now => {
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@Siddharth11
Siddharth11 / media-mixin.scss
Created February 2, 2015 21:15
SCSS Media Query Mixin
@mixin medmxn($mnw, $mxw) {
@media all and (min-width: $mnw) and (max-width: $mxw) {
@content;
}
}
@mixin medmx($mxw) {
@media all and (max-width: $mxw) {
@content;
}
}