Skip to content

Instantly share code, notes, and snippets.

@Mukundhan-I2I
Mukundhan-I2I / docker-cleanup-resources.md
Created April 10, 2020 14:43 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

/* eslint-disable import/no-extraneous-dependencies, prefer-template */
// const validateBoolOption = (name, value, defaultValue) => {
// if (typeof value === 'undefined') {
// value = defaultValue;
// }
// if (typeof value !== 'boolean') {
// throw new Error(`Preset react-app: '${name}' option must be a boolean.`);
// }

MySQL Download URL

https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
@Mukundhan-I2I
Mukundhan-I2I / create_kinesis_stream.sh
Created January 25, 2020 23:05 — forked from etspaceman/create_kinesis_stream.sh
Local Kinesis Setup w/ LocalStack
#!/usr/bin/env bash
export $(cat .env | xargs)
KINESIS_STREAM_SHARDS=${KINESIS_STREAM_SHARDS:-1}
export USE_SSL=true
awslocal kinesis create-stream --shard-count ${KINESIS_STREAM_SHARDS} \
--stream-name ${KINESIS_STREAM_NAME}
@Mukundhan-I2I
Mukundhan-I2I / checkstyle.xml
Created October 29, 2019 10:23 — forked from pengisgood/checkstyle.xml
checkstyle 8.1 example
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
http://java.sun.com/docs/books/jls/second_edition/html/index.html
@Mukundhan-I2I
Mukundhan-I2I / gist:3179fa725a9d49a4bac68a7c9e3a8c3d
Created September 20, 2019 08:42 — forked from zeuxisoo/gist:980174
How to use git diff to patch file

Create patch file

git diff --no-prefix > [path file name]

Apply path file

patch -p0 < [path file name]

@Mukundhan-I2I
Mukundhan-I2I / actions.products.js
Created November 20, 2018 11:30 — forked from lovio/actions.products.js
redux-sagas utils
import { createConstAndAction, createFetchTypesAndFuncs } from './utils';
export const { PRODUCTS, products } = createFetchTypesAndFuncs('products');
export const { LOAD_PRODUCTS, loadProducts } = createConstAndAction('LOAD_PRODUCTS');
// these actions is for pull-to-load-more
export const { LOAD_MORE_PRODUCTS, loadMoreProducts } = createConstAndAction('LOAD_MORE_PRODUCTS');
@Mukundhan-I2I
Mukundhan-I2I / box-shadow.html
Created May 10, 2018 07:34 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@Mukundhan-I2I
Mukundhan-I2I / SCSS.md
Created May 9, 2018 10:42 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@Mukundhan-I2I
Mukundhan-I2I / coordinating-async-react.md
Created April 19, 2018 07:29 — 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?