Skip to content

Instantly share code, notes, and snippets.

View azhar25git's full-sized avatar
💻
Coding is life

Azhar Uddin azhar25git

💻
Coding is life
View GitHub Profile
@azhar25git
azhar25git / User.php
Created February 28, 2018 12:25 — forked from bramnauta/User.php
app/User.php
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

<?php
class CustomerAddress extends Model {
protected function setKeysForSaveQuery(Builder $query)
{
$query
->where('Customer_No', '=', $this->getAttribute('Customer_No'))
->where('Address_Name', '=', $this->getAttribute('Address_Name'));
@azhar25git
azhar25git / get domain without subdomain.php
Created December 25, 2019 11:34 — forked from pocesar/get domain without subdomain.php
PHP code to get the domain name without subdomains (includes the tld, and the special types from IANA). Don't have support for unicode domain names.
<?php
/**
* @param string $domain Pass $_SERVER['SERVER_NAME'] here
* @param bool $debug
*
* @debug bool $debug
* @return string
*/
function get_domain($domain, $debug = false)
{
@azhar25git
azhar25git / next_nginx.md
Created August 16, 2020 06:48 — forked from kocisov/next_nginx.md
How to setup next.js app on nginx with letsencrypt

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@azhar25git
azhar25git / README.md
Last active February 13, 2024 12:21 — forked from oodavid/README.md
Deploy your site with git (UPDATED: August 2020)

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@azhar25git
azhar25git / System Design.md
Created October 1, 2020 18:39 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?