Skip to content

Instantly share code, notes, and snippets.

View gokulkrishh's full-sized avatar

Gokulakrishnan Kalaikovan gokulkrishh

View GitHub Profile
@gokulkrishh
gokulkrishh / alignments.css
Last active February 7, 2022 15:08
CSS Layout - Align an element Horizontal & Vertical center
/* HTML */
<div class="container">
<div class="child"></div>
<div>
/* Basic Style */
.container {
width: 500px;
@gokulkrishh
gokulkrishh / OOCSS.md
Last active January 5, 2019 10:52
OOCSS

OOCSS - Object Oriented CSS

Two Main Principels

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

Seperation of structure from skin

Example:

@gokulkrishh
gokulkrishh / git-io-custom-url.md
Last active November 12, 2020 20:31
Create a custom (repo name) name in git.io
curl https://git.io/ -i -F "url=<repo-url>" -F "code=<repo-name>"

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

@gokulkrishh
gokulkrishh / Object.create.js
Created March 24, 2019 06:19
A simple polyfil for Object.create method.
// without 2nd argument support
if (typeof Object.create !== 'function') {
Object.create = function(o, props) {
function F() {}
F.prototype = o;
return new F();
}
}
@gokulkrishh
gokulkrishh / useful-npx-commands.md
Last active April 10, 2025 17:31
List of useful npx (Node Package Runner) commands (https://git.io/useful-npx-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.

Commands

@gokulkrishh
gokulkrishh / index.js
Last active December 7, 2024 19:15
List the visual studio code installed extensions (https://git.io/installed-vscode-extenstions)
#!/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 / README.md
Last active January 27, 2020 04:24
How to debug/develop npm package

How to debug/develop npm package

Source

npm link

Destination

@gokulkrishh
gokulkrishh / index.md
Last active March 2, 2020 05:17
Useful javascript util functions

Useful javascript util functions

Table of contents

Flatten Object

@gokulkrishh
gokulkrishh / margin-collapsing.md
Last active September 16, 2024 16:34
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.