Skip to content

Instantly share code, notes, and snippets.

View mhmdAljefri's full-sized avatar
🏠
Working from home

Muhammad Al-jefry mhmdAljefri

🏠
Working from home
View GitHub Profile
@mhmdAljefri
mhmdAljefri / postgres-cheatsheet.md
Created January 8, 2018 08:15 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

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 / 00.md
Created January 25, 2018 05:58 — forked from maxivak/00.md
Sending emails with ActionMailer and Sidekiq

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.

ActionMailer

Create your mailer us usual:

# 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>
# 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
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
@mhmdAljefri
mhmdAljefri / install.sh
Last active February 27, 2019 14:37 — forked from ali-sheiba/install.sh
Setup Ubuntu Server with Ngnix + MySQL + Redis + Git + RVM + Ruby 2.4.0 + Ruby On Rails
#!/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
function isSubset(array1, array2) {
  const filterdArray2Set = [...new Set(array2)]; // return uniq array

  let subset = false
  filterdArray2Set.forEach((item) => {
    subset = array1.includes(item)
 if (!subset) return;
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
def add_flipper_pods!(versions = {})
versions['Flipper'] ||= '~> 0.33.1'
versions['DoubleConversion'] ||= '1.1.7'
versions['Flipper-Folly'] ||= '~> 2.1'
versions['Flipper-Glog'] ||= '0.3.6'
versions['Flipper-PeerTalk'] ||= '~> 0.0.4'
versions['Flipper-RSocket'] ||= '~> 1.0'