Skip to content

Instantly share code, notes, and snippets.

Working from home

Gokulakrishnan Kalaikovan gokulkrishh

Working from home
View GitHub Profile
gokulkrishh /
Last active May 10, 2020
margin collapsing in css

There are two main types of margin collapse:

  • Collapsing margins between adjacent elements
  • Collapsing margins between parent and child elements

Using a padding or border will prevent collapse only when Collapsing is between parent and children. Also, any value of overflow different from its default (visible) applied to the parent will prevent collapse.

Thus, both overflow: auto and overflow: hidden will have the same effect.

gokulkrishh /
Last active Mar 2, 2020
Useful javascript util functions

Useful javascript util functions

Table of contents

Flatten Object

gokulkrishh /
Last active Jan 27, 2020
How to debug/develop npm package

How to debug/develop npm package


npm link


gokulkrishh / index.js
Last active Dec 19, 2019
List the visual studio code installed extensions (
View index.js
#!/usr/bin/env node
const { exec } = require('child_process');
exec('code --list-extensions', (err, stdout) => {
if (err) console.log('Error occurred', err);
const extensions = stdout.split('\n').filter(extension => extension);
console.log(`\n✅ Installed VS Code Extensions: ${extensions.length} \n`);
gokulkrishh /
Last active Jul 21, 2020
List of useful npx (Node Package Runner) commands (

NPX (NPM Package Runner) Commands

List of useful npx (NPM Package Runner) commands.

What is NPX?

Using NPX we can execute/run node binaries without the need to install it locally or globally.


gokulkrishh / Object.create.js
Created Mar 24, 2019
A simple polyfil for Object.create method.
View Object.create.js
// without 2nd argument support
if (typeof Object.create !== 'function') {
Object.create = function(o, props) {
function F() {}
F.prototype = o;
return new F();
gokulkrishh /
Last active Feb 26, 2019
Create a custom (repo name) name in
curl -i -F "url=<repo-url>" -F "code=<repo-name>"

Above command will give you something like


OOCSS - Object Oriented CSS

Two Main Principels

  • Seperation of structure from skin
  • Seperation of container & content

Seperation of structure from skin


gokulkrishh / alignments.css
Last active Jun 3, 2020
CSS Layout - Align an element Horizontal & Vertical center
View alignments.css
/* HTML */
<div class="container">
<div class="child"></div>
/* Basic Style */
.container {
width: 500px;
You can’t perform that action at this time.