Skip to content

Instantly share code, notes, and snippets.

View vasanthk's full-sized avatar

Vasa vasanthk

View GitHub Profile
@vasanthk
vasanthk / for-snook.md
Created December 16, 2018 20:37 — forked from threepointone/for-snook.md
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

@vasanthk
vasanthk / README.md
Created December 15, 2018 16:01 — forked from roachhd/README.md
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@vasanthk
vasanthk / 1. bad.js
Created December 14, 2018 08:15
Avoid Creating Unnecessary Promises!!
const { promisify } = require('util')
const timeout = promisify(setTimeout)
async function bar() { await timeout(1000) }
// The idea here is that we don't know if foo
// is going to return a Promise or not, so just
// in case, force it to return a Promise.
// Unfortunately, doing it this way creates
// quite a few additional unnecessary Promises
@vasanthk
vasanthk / CordovaDevtools.md
Created August 6, 2018 23:38 — forked from Mohamed3on/CordovaDevtools.md
Inspect Cordova/Ionic apps with Chrome Devtools
  1. Connect your Android device
  2. Make sure it's working correctly with adb and you can find it when you run adb devices
  3. In the directory of your app, run cordova run android --device, Now the app will run on your device
  4. Go to chrome://inspect/#devices on your Chrome browser, and select your app and click inspect
  5. Now you can inspect the HTML/CSS, and debug your JS with ease!
@vasanthk
vasanthk / git_submodules.md
Created July 10, 2018 21:36 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@vasanthk
vasanthk / coordinating-async-react.md
Created May 20, 2018 19:45 — forked from acdlite/coordinating-async-react.md
Demo: Coordinating async React with non-React views

Demo: Coordinating async React with non-React views

tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.

A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.

But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.

How do we solve this with React?

@vasanthk
vasanthk / prepack-gentle-intro-1.md
Created May 8, 2018 21:52 — forked from gaearon/prepack-gentle-intro-1.md
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.

Questions to ask potential employers

  • How long do you expect it would take me to deploy my first change? To become productive? To understand the codebase?
  • What's the longest tenure of a developer at this company?
  • How long has the top quarter of the developers been here?
  • What fraction of the developers have been here less than 6 months?
  • How long does it take to do a complete deployment?
  • How large are PRs? For a "big" PR, how many lines of code? How long is it open?
  • How often do you have major outages? What constitutes a major outage for you?
  • Do you have a defined process for the aftermath of an outage?
@vasanthk
vasanthk / quiz.md
Created April 23, 2018 22:47 — forked from gaearon/quiz.md

A top-level App component returns <Button /> from its render() method.

  1. What is the relationship between <Button /> and this in that Button’s render()?

  2. Does rendering <Button><Icon /></Button> guarantee that an Icon mounts?

  3. Can the App change anything in the Button output? What and how?


Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets