Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Gokulakrishnan Kalaikovan gokulkrishh

🏠
Working from home
Block or report user

Report or block gokulkrishh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gokulkrishh
gokulkrishh / margin-collapsing.md
Last active May 10, 2020
margin collapsing in css
View margin-collapsing.md

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
gokulkrishh / index.md
Last active Mar 2, 2020
Useful javascript util functions
View index.md

Useful javascript util functions

Table of contents

Flatten Object

@gokulkrishh
gokulkrishh / README.md
Last active Jan 27, 2020
How to debug/develop npm package
View README.md

How to debug/develop npm package

Source

npm link

Destination

@gokulkrishh
gokulkrishh / index.js
Last active Dec 19, 2019
List the visual studio code installed extensions (https://git.io/installed-vscode-extenstions)
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
gokulkrishh / useful-npx-commands.md
Last active Mar 11, 2020
List of useful npx (Node Package Runner) commands (https://git.io/useful-npx-commands)
View useful-npx-commands.md

NPX (Node Package Runner) Commands

List of useful npx (Node Package Runner) commands.

What is NPX?

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

Commands

@gokulkrishh
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
gokulkrishh / git-io-custom-url.md
Last active Feb 26, 2019
Create a custom (repo name) name in git.io
View git-io-custom-url.md
curl https://git.io/ -i -F "url=<repo-url>" -F "code=<repo-name>"

Above command will give you something like git.io/repo-name

View OOCSS.md

OOCSS - Object Oriented CSS

Two Main Principels

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

Seperation of structure from skin

Example:

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