Skip to content

Instantly share code, notes, and snippets.

Muhammad Al-jefry mhmdAljefri

Block or report user

Report or block mhmdAljefri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View code_spliting_hoc.js
import React from 'react'
const codeSplittingHoc = impoertComponent =>
class componentName extends React.Component {
state = {
component: null // default state for component
}
async componentDidMount() {
const { default: component } = await impoertComponent(); // import default from function and assign it to component
View zsh
# Zsh
sudo apt install zsh
# If you have problem with adminstration folder
# remove lock folder from desk and cash follow next setps (optioal)
sudo rm /var/lib/apt/lists/lock
#remove from cash
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
View Postgresql cmd
# instructio of first using postger
# OPEN CLI AS ROOT
sudo -u postgres psql
#command above open cli as super admin
#CREATE USER
sudo -u postgres createuser <username>
@mhmdAljefri
mhmdAljefri / 00.md
Created Jan 25, 2018 — forked from maxivak/00.md
Sending emails with ActionMailer and Sidekiq
View 00.md

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.

ActionMailer

Create your mailer us usual:

@mhmdAljefri
mhmdAljefri / postgres-cheatsheet.md
Created Jan 8, 2018 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet
View postgres-cheatsheet.md

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@mhmdAljefri
mhmdAljefri / install.sh
Last active Feb 27, 2019 — forked from ali-sheiba/install.sh
Setup Ubuntu Server with Ngnix + MySQL + Redis + Git + RVM + Ruby 2.4.0 + Ruby On Rails
View install.sh
#!/bin/sh
# ngix + required packages
sudo apt update
sudo apt upgrade -y
sudo apt install curl git-core nginx build-essential tcl8.5 -y
sudo apt install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
# mysql
You can’t perform that action at this time.