Skip to content

Instantly share code, notes, and snippets.

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

Adewuyi Taofeeq Olamilekan harmlessprince

🏠
Working from home
View GitHub Profile
@JustSteveKing
JustSteveKing / Laravel Repository.php
Created August 7, 2021 06:57
An example on Laravel Eloquent Repository
<?php
abstract class Repository
{
protected Builder $query;
public function all(): null|Collection
{
return $this->query->get();
}
@yavgel85
yavgel85 / Laravel Controller to upload, zip, password protect the zip, save the password encrypted.php
Created March 26, 2021 08:24
Laravel Controller to upload, zip, password protect the zip, save the password encrypted #laravel
<?php
// The issue this solves is to allow the user to upload a document and for us to save the document such that: the document is zip'd, the zip file is given a unique name, the zip file is password protected with a unique password, the password is encrypted for storage in the db table.
// The following will allow for creating one codeset to be called for the creation of all Documents.
// For the moment, we will need to set up IF statements for the statement that creates an instance of $Document
// which will allow for us to create a new entry in the appropriate database table.
public function storeInitDocument($request, $id, $theUserID, $ignore, $tableName){
// This function will determine if the User has uploading any documents. If so, the document's properties will be stored,
// followed by the storage of the physical document with a unique name. The document will be
# Read more about setting it up
# https://medium.com/@ljmocic/deploying-react-application-to-aws-s3-using-github-actions-85addacaeace
on:
push:
tags:
- '*'
jobs:
build:
@gjerokrsteski
gjerokrsteski / remove env file from git forever
Last active July 11, 2024 08:40
remove env file from git history forever
echo '.env' >> .gitignore
git rm -r --cached .env
git add .gitignore
git commit -m 'untracking .env'
git push origin master
@hasibdesk
hasibdesk / How to run multiple NodeJs app on same server and different domain and run all app concurrently using Nginx.md
Created November 30, 2019 03:49
Run multiple nodejs app in same server with different domain and run all app concurrently

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

Sometimes we need to run multiple nodejs app on same server with different domain or sub domain like admin.domain.com, api.domain.com and also need to run both nodejs or reactjs app concurrently. We can do this using 2 things , first of all we need to install nginx in our server for reverse proxy to connect different domain, and for running multiple nodejs app concurrently we can use PM2 NodeJs Process Manager

Please Make sure that you have installed these things on your server

  • NodeJS
@arthursalvtr
arthursalvtr / add-custom-mail-driver-to-laravel.md
Last active April 5, 2024 17:43
Add Custom Mail Driver to Laravel

How to add custom Mail Driver to Laravel

Tested on Laravel 5.8

Within the source code of laravel 5.8 at this time of writing, we have this following

<?php

namespace Illuminate\Support;
@ajepe
ajepe / md
Created January 15, 2019 07:56
Nigeria Banks sort code
{
"070010": "ABBEY MORTGAGE BANK-070010",
"044": "ACCESS BANK PLC-044",
"323": "AccessMobile-100013",
"090134": "ACCION MICROFINANCE BANK-090134",
"090160": "ADDOSSER MICROFINANCE BANK-090160",
"100028": "AG MORTGAGE BANK PLC-100028",
"090133": "AL-BARAKAH MICROFINANCE BANK-090133",
"090180": "AMJU UNIQUE MICROFINANCE BANK-090180",
"090116": "AMML MFB-090116",
@Pezhvak
Pezhvak / supervisor-mac-installation.md
Last active November 15, 2023 13:35
Supervisor Mac Installation (Laravel)

alright, everybody writen one about this but nothing worked for me, here's how it works without any problem:

first run brew install supervisor

run brew services start supervisor now to start supervisor, this will make sure supervisor runs at startup as well.

supervisor searches for configuration file in following paths: /usr/local/etc/supervisord.conf, /usr/local/supervisord.conf, supervisord.conf, etc/supervisord.conf, /etc/supervisord.conf, /etc/supervisor/supervisord.conf

we have to create one in order for it to work:

@mstenta
mstenta / parse-kml.php
Last active February 8, 2024 07:36 — forked from woodbri/parse-kml.php
Script to parse a kml file
<?php
// Enter the name of the KML file here.
$kml_filename = '';
$xml = simplexml_load_file($kml_filename);
$folders = $xml->Document->Folder;
foreach ($folders as $folder) {
print "Name: " . $folder->name . "\n";
print "Description: " . $folder->description . "\n";
@Propaganistas
Propaganistas / MailHog configuration
Last active July 24, 2024 18:33
Laravel MailHog SMTP configuration
# Mailhog
MAIL_MAILER=smtp
MAIL_HOST=0.0.0.0
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null