Skip to content

Instantly share code, notes, and snippets.

View kuldeepkeshwar's full-sized avatar
👨‍💻
Code

Kuldeep Keshwar kuldeepkeshwar

👨‍💻
Code
View GitHub Profile
@tanaypratap
tanaypratap / to-recruiters.md
Last active February 4, 2021 05:29
Looking to hire Tanay Pratap? Kindly go through this.

Dear Recruiter,

First of all thanks for contacting me for the role which you have in mind. Let me tell you that I am extremely happy and contented at my current workplace. It provides a competing salary, a challenging environment and world class culture.

However, I am always open to better opportunities. But finding a time to get on a call for every inMail/message/opportunity is tough. So, let's continue this async form of communication where you give me details of the job and let me decide if I want to pursue it further.

Few details which I am looking for:

  • Salary range Kindly do not ask my current CTC as I am not supposed to tell you that. As a recruiter, you're very much aware of the competing salary ranges in my domain with relevant experience. If the recruitment process requires the knowledge of my current CTC, I am sorry but I won't be further interested into that.
  • Company Name If not an extremely famous brand, then please provide company's URL and background.
  • Profile I do not pe
@kentcdodds
kentcdodds / login.js
Last active January 28, 2019 18:04
Example of a test that doesn't use enzyme or TestUtils
import React from 'react'
function Login({onSubmit}) {
return (
<div>
<form
data-test="login-form"
onSubmit={e => {
e.preventDefault()
const {username, password} = e.target.elements
@kerryboyko
kerryboyko / README.md
Last active April 26, 2023 16:08
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@developit
developit / purecomponent.js
Created April 25, 2017 11:43
PureComponent for preact
import { Component } from 'preact';
export default class PureComponent extends Component {
shouldComponentUpdate(props, state) {
return !(shallowEqual(props, this.props) && shallowEqual(state, this.state));
}
}
function shallowEqual(a, b) {
for (let key in a) if (a[key]!==b[key]) return false;
@Directive({
selector: '[universalAd],[universal-ad]'
})
class UniversalAd {
constructor(
@Attribute('id') public id: string,
public adRegistry: MyAdRegistry,
public elementRef: ElementRef,
public cdRef: ChangeDetectorRef) {
@PatrickJS
PatrickJS / api.service.ts
Last active September 18, 2017 18:07
Universal Cache
// Something like this. I haven't tested this file
@Injectable()
export class ApiService {
constructor(public _http: Http, public _cache: Cache) {
}
// whatever domain/feature method name
getModel(url) {
// you want to return the cache if there is a response in it. This would cache the first response so if your API isn't idempotent you probably want to remove the item from the cache after you use it. LRU of 1
@TheLarkInn
TheLarkInn / explanation.md
Last active June 7, 2018 13:33
Understanding some CommonsChunksPlugin teqniques

When you use the names property in the CommonsChunkPlugin({}) and pass an array as the value, webpack converts what is seen below:

      new webpack.optimize.CommonsChunkPlugin({
        names: ['app', 'vendor', 'manifest'],  // creating manifest.js 
        minChunks: Infinity
      })

Into:

@PatrickJS
PatrickJS / index.html
Last active May 5, 2017 15:24
How to build your own Angular Universal integrations for Angular 2
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>index as a string</title>
</head>
<body>
<app>
Loading...
@Hypercubed
Hypercubed / .gitignore
Last active May 22, 2017 23:44
Bad value context for arguments value
jspm_packages
@paulirish
paulirish / what-forces-layout.md
Last active July 30, 2024 18:27
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent