Skip to content

Instantly share code, notes, and snippets.

View horlathunbhosun's full-sized avatar
🎯
Focusing

Olulode Olatunbosun horlathunbhosun

🎯
Focusing
View GitHub Profile
@horlathunbhosun
horlathunbhosun / EmailService.java
Created May 19, 2024 12:23
EmailService Class
@Service
@RequiredArgsConstructor
public class EmailService {
private final JavaMailSender emailSender;
@Value("${application.mail.sent.from}")
private String fromUsr;
public void sendEmail(String to, String subject, String body) throws MessagingException {
MimeMessage message = emailSender.createMimeMessage();
{
"sync.gist": "0e21173676d1a5b66bdc9dcebcf59a1f"
}
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
@horlathunbhosun
horlathunbhosun / in_array_r()
Created September 28, 2020 14:55 — forked from Billy-/in_array_r()
in_array_r() - a multidimensional version of PHP's in_array()
function in_array_r($needle, $haystack, $strict = false) {
foreach ($haystack as $item) {
if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {
return true;
}
}
return false;
}
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/horlathunbhosun/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
server {
root /var/www/app/public;
index index.php;
server_name domain;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt -y install php7.4
sudo apt-get install php-mbstring
sudo apt-get install php-zip
sudo apt-get install php-xml
sudo apt-get install php-mysql
@horlathunbhosun
horlathunbhosun / Inflect.php
Created July 7, 2020 08:12 — forked from tbrianjones/Inflect.php
A PHP Class for converting English words between Singular and Plural.
<?php
// original source: http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
/*
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy
<?php
$handle = fopen ("php://stdin", "r");
function compareTriplets($a0, $a1, $a2, $b0, $b1, $b2){
// Complete this function
$alice = 0;
$bob = 0;
$alice += ($a0 > $b0? 1:0) + ($a1 > $b1? 1:0) + ($a2 > $b2? 1:0);
$bob += ($b0 > $a0? 1:0) + ($b1 > $a1? 1:0) + ($b2 > $a2? 1:0);
<?php
$handle = fopen ("php://stdin", "r");
function compareTriplets($a0, $a1, $a2, $b0, $b1, $b2){
// Complete this function
$alice = 0;
$bob = 0;
$alice += ($a0 > $b0? 1:0) + ($a1 > $b1? 1:0) + ($a2 > $b2? 1:0);
$bob += ($b0 > $a0? 1:0) + ($b1 > $a1? 1:0) + ($b2 > $a2? 1:0);