Skip to content

Instantly share code, notes, and snippets.

View manashcse11's full-sized avatar

Manash Kumar Chakrobortty manashcse11

  • Cefalo
  • Dhanmondi, Dhaka
View GitHub Profile
@manashcse11
manashcse11 / xdebug-phpstorm.md
Last active September 15, 2022 05:55
Configure xdebug with phpstorm

Browser based debuging

  • Install xdebug for debian: sudo apt-get install php-xdebug
  • Open php.ini to edit
    • Location for php artisan serve or built in server: /etc/php/8.1/cli

    • Location for apache: /etc/php/8.1/apache2

      [xdebug]
      zend_extension=xdebug.so

@manashcse11
manashcse11 / git-ssh-error-fix.sh
Created February 17, 2021 07:20 — forked from Tamal/git-ssh-error-fix.sh
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@manashcse11
manashcse11 / laravel-docker-local-environment.md
Last active November 7, 2020 16:11
Local docker setup for Laravel
@manashcse11
manashcse11 / docker-compose-SAMPLE.yml
Created October 6, 2020 17:07
Sample docker-compose file
version: "2"
services:
app:
build:
args:
user: sammy
uid: 1000
context: ./
dockerfile: Dockerfile
image: laravel_docker
import React, { useContext } from 'react';
import { UserContext } from '../UserContext';
const UpdateContextData = () => {
const user = useContext(UserContext);
return (
<div>
<h3>Update context data</h3>
<div className="form-group">
<label>Name</label>
import React, { useContext } from 'react';
import { UserContext } from '../UserContext';
const ShowContextData = () => {
const user = useContext(UserContext);
return (
<div>
<h3>
Showing from context
</h3>
import React, { useState } from 'react';
import './App.css';
import { connect } from 'react-redux';
import { addUserData } from './redux/actions';
const App = ({ user, addUserData }) => {
const [name, setName] = useState(user != null ? (user.hasOwnProperty('name') ? user.name : '') : '');
const [profession, setProfession] = useState(user != null ? (user.hasOwnProperty('profession') ? user.profession : '') : '');
import React from 'react';
import ReactDOM from 'react-dom';
/** Redux */
import { Provider } from 'react-redux';
import { persistor, store } from "./redux/store";
import { PersistGate } from 'redux-persist/integration/react';
/** End */
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import { combineReducers } from "redux";
import User from "./user";
export default combineReducers({ User });
import {ADD_USER_DATA} from "../actionTypes";
const initialState = {
user: null
};
const User = (state = initialState, action) => {
switch (action.type) {
case ADD_USER_DATA: {
const { user } = action.payload;
return {