Skip to content

Instantly share code, notes, and snippets.

View itsmunim's full-sized avatar
💂‍♂️
Extension over Modification...please!

Md Abdul Munim itsmunim

💂‍♂️
Extension over Modification...please!
View GitHub Profile
@itsmunim
itsmunim / .gitconfig
Created April 3, 2020 07:02
.gitconfig with necessary aliases
[alias]
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# View the current working tree status using the short format
st = status
br = branch
co = checkout
# Rebases with a remote branch- git rebase-with upstream remote-branch
const header = document.getElementsByClassName('header')[0];
const statusElem = document.getElementById('status-txt');
const listener = ({ status }) => {
const emoji = status === 'normal' ? '🙄' : '😝';
statusElem.innerText = `${status.replace(/-/g, ' ').toUpperCase()} ${emoji}`;
};
ScrollToStick.applyScrollToStick('header-wrap', header.offsetHeight, { listener });
<script>
const header = document.getElementsByTagName('header')[0];
// the offsetHeight determines how much of header wrap gets hidden with scroll
ScrollToStick.applyScrollToStick('header-wrap', header.offsetHeight);
</script>
<div id="header-wrap" class="header-wrap">
<header> # <--- this will get hidden while scrolling downwards
<div class="logo"></div>
<div class="brand-title"></div>
</header>
<div class="menu-strip"> # <--- this menu strip or tab like menu will be visible while scrolling downwards
<div class="menu-item"></div>
<div class="menu-item"></div>
<div class="menu-item"></div>
class SwimMixin {
// prevents duplication of implementation;
// can be a helper/util class as well
swim(context) {
// swim implementation
}
}
class Animal {
walk() {
@itsmunim
itsmunim / scrolltostick-sample-purejs.html
Last active February 2, 2020 07:34
Using ScrollToStick
<!-- include scrolltostick -->
<script src="vendors/scroll-to-stick/dist/scroll.to.stick.js"></script>
<!-- or as npm module -->
<script>
import {applyScrollToStick} from 'scroll-to-stick';
</script>
<!-- in react -->
<script>
package com.airasia.samples.codeorder;
import java.awt.color.CMMException;
import java.awt.color.ColorSpace;
/**
* A recommended approach to organize your code flow
*/
public class CodeSample {
/* Properties */
import React from 'react';
import React, { Component } from 'react';
import classNames from 'classnames';
import { eventName, eventTime, eventStatus, getTitle } from './DockListHelpers';
import './EventList.css';
function EventItem(eventItem: DockData, eventTitle: string): ReactComponent {
return (
<li
className="EventList-item admin-page-list-item"
@itsmunim
itsmunim / nginx.reverseproxy.config
Created September 4, 2018 18:38
A simple nginx config to provide multiple frontends in different route; with ssl by letsencrypt
server {
server_name example.com www.example.com;
listen [::]:443 ssl ipv6only=on;
listen 443 ssl;
ssl_certificate /your_cert_path/fullchain.pem;
ssl_certificate_key /your_cert_path/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
// This is a simple sample of how an event pool like thing can work as delegator
// between angular and react world; where both are co-existing.
// The goal is to let react component know whenever something gets broadcasted
// or emitted in angular $scope, without sharing/injecting angular specific code into it.
// EventPool.js
class EventPool {
constructor() {
this._eventsMap = {};
}