Skip to content

Instantly share code, notes, and snippets.

Avatar

Gokulakrishnan Kalaikovan gokulkrishh

View GitHub Profile
@gokulkrishh
gokulkrishh / media-query.css
Last active Sep 24, 2022
CSS Media Queries for Desktop, Tablet, Mobile.
View media-query.css
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@gokulkrishh
gokulkrishh / useful-npx-commands.md
Last active Sep 16, 2022
List of useful npx (Node Package Runner) commands (https://git.io/useful-npx-commands)
View useful-npx-commands.md

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 / event-loop.md
Created Feb 10, 2017 — forked from jesstelford/event-loop.md
Event Loop and Call Stack
View event-loop.md

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@gokulkrishh
gokulkrishh / margin-collapsing.md
Last active Mar 4, 2022
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 / alignments.css
Last active Feb 7, 2022
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;
@gokulkrishh
gokulkrishh / git.md
Created Feb 2, 2022
A list of useful git commands
View git.md

Git add to be case-senstive

git config core.ignorecase false

Git autocorrections

git config --global help.autocorrect 1
@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 / index.js
Last active Dec 10, 2021
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 / git-io-custom-url.md
Last active Nov 12, 2020
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