Skip to content

Instantly share code, notes, and snippets.

Avatar
🔍
Focusing

Manoj Kiran ManojKiranAppathurai

🔍
Focusing
View GitHub Profile
View website.backup.sh
#!/bin/bash
#
# Website Backup Shell Script
# by Andrew Currie (andrew@digitalpci.com)
#
# Performs a full backup of the specified database and document root.
# Be sure to edit the configuration options at the beginning of the file to match your environment prior to executing.
# The end result will be one TAR archive with the name 'website-backup-(current-datestamp)'.
# The backup includes the entire document root directory and also a 'database.sql' file containing a MySQL dump of the database.
#
@ManojKiranAppathurai
ManojKiranAppathurai / child-filepath.md
Created Jun 17, 2022 — forked from joemaller/child-filepath.md
Get PHP child Class file paths from inherited parent class methods
View child-filepath.md

Get PHP child Class file paths from inherited parent class methods

While refactoring some code into a reusable PHP Class I hit a brief roadblock where some code expected the [__FILE__ magic constant][file] file path. Since that value always refers to the specific file it's called from, it won't work from a separate Class file because the referenced path would be the parent instead of the child.

The full filepath of a child Class can be inferred from an inherited parent Class method by combining [get_class($this)][get_class] or [get_called_class()][get_called_class] with the [ReflectionClass::getFileName][getfilename] method like this:

// ParentClass.php
class ParentClass
{
@ManojKiranAppathurai
ManojKiranAppathurai / MatrimonialReligionAndCaste.json
Created Jun 3, 2022 — forked from Dhaneshmonds/MatrimonialReligionAndCaste.json
Indian Matrimonial Website Religion and Caste json file
View MatrimonialReligionAndCaste.json
{
"religion": [
{
"id": "1",
"name": "Hindu",
"castealias":"Caste",
"castes": [
{
"id": "0",
"name": "-- Select --"
@ManojKiranAppathurai
ManojKiranAppathurai / Readme.md
Created May 27, 2022 — forked from pxlrbt/Readme.md
Filament Geocoder
View Readme.md

Usage

  • Install Geocoder Laravel: https://geocoder-php.org/docs/
  • Publish config php artisan vendor:publish (Look for Geocoder)
  • Setup your Google Geocoding API-Key in config/geocoder.php
View languages.json
{
"ab":{
"name":"Abkhaz",
"nativeName":"аҧсуа"
},
"aa":{
"name":"Afar",
"nativeName":"Afaraf"
},
"af":{
@ManojKiranAppathurai
ManojKiranAppathurai / download_csv.php
Created Nov 30, 2021 — forked from mpijierro/download_csv.php
Example streaming large CSV files with Laravel and thousands of queries
View download_csv.php
<?php
namespace Src\Csv;
use Illuminate\Http\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
/**
* Class DownloadLargeCsv
*
@ManojKiranAppathurai
ManojKiranAppathurai / explain.md
Created Mar 3, 2021
Livewire - React to Server Side Events
View explain.md

Reacting to server side Laravel events (no websockets)

I used a custom directive to implement this, but essentially:

<div wire:new-like="loadLikes">
  
</div>
@ManojKiranAppathurai
ManojKiranAppathurai / .gitignore
Created Feb 12, 2021 — forked from octocat/.gitignore
Some common .gitignore configurations
View .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@ManojKiranAppathurai
ManojKiranAppathurai / List.md
Created Dec 17, 2020 — forked from msurguy/List.md
List of open source projects made with Laravel
View List.md

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):