Skip to content

Instantly share code, notes, and snippets.

View hemel-cse's full-sized avatar
🎯
Focusing

Md Hashibul Amin hemel-cse

🎯
Focusing
View GitHub Profile

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@hemel-cse
hemel-cse / Iframe.js
Created July 15, 2020 11:48 — forked from msmfsd/Iframe.js
React iframe component
/*
INIT: ensure Babel/Eslint/Flow is configured for ES Class Fields & Static Properties
JSX USAGE: <Iframe src='http://web.site' onLoad={myOnloadFunction}/>
*/
import React, { Component, PropTypes } from 'react'
import ReactDOM from 'react-dom'
class Iframe extends Component {
static propTypes: Object = {
//fetch using a Request and a Headers objects
//using jsonplaceholder for the data
const uri = 'http://jsonplaceholder.typicode.com/users';
//new Request(uri)
//new Request(uri, options)
//options - method, headers, body, mode
//methods: GET, POST, PUT, DELETE, OPTIONS
@hemel-cse
hemel-cse / media-query.css
Created June 13, 2019 14:39 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
$(document).on("click",".tm-qty-minus", function () {
var p = $(this).parent().find('input').val();
var pp = $(this).parents().find('.price').html();
var price = pp.slice(1);
price = parseFloat(price)
$('span.woocommerce-Price-amount.amount').html('<span class="woocommerce-Price-currencySymbol">$</span>'+(p*price).toFixed(2));
console.log(p, pp, price);
});
$(document).on("click",".tm-qty-plus", function () {
@hemel-cse
hemel-cse / setup-kubernetes-ubuntu-16.md
Created March 18, 2019 03:51 — forked from ruanbekker/setup-kubernetes-ubuntu-16.md
Install a 3 Node Kubernetes Cluster on Ubuntu 16

Master: Dependencies

apt update && apt upgrade -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
function Square(props) {
return (
<button className="square" onClick={props.onClick}>
{props.value}
</button>
);
}
class Board extends React.Component {
renderSquare(i) {
@hemel-cse
hemel-cse / caching.conf
Created January 29, 2019 15:47 — forked from TrafeX/caching.conf
Nginx Wordpress caching
# The path to store the cache files, limit the folder to 100MB
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m;
# A unique request is defined by this cache key
fastcgi_cache_key "$scheme$request_method$host$request_uri";
# Show the cached version if upstream gives a timeout or a HTTP 500 error
fastcgi_cache_use_stale error timeout invalid_header http_500;
# Don't use the following headers to define the cache variables
@hemel-cse
hemel-cse / pm2-404-not-found-solution
Created October 15, 2018 00:21
Custom 404 error not found page for PM2 with react SPA serving with nginx
As per code: https://github.com/Unitech/pm2/blob/master/lib/API/Serve.js#L225
Just need an additional page name 404.html in the build folder.
As create a 404.html page and design it and the pm2 will serve it.
@hemel-cse
hemel-cse / Default Nginx Config File
Created October 13, 2018 01:58
Default Nginx Config File
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#