Skip to content

Instantly share code, notes, and snippets.

View Xatta-Trone's full-sized avatar
🏠
Working from home

Monzurul Islam Xatta-Trone

🏠
Working from home
View GitHub Profile
@Xatta-Trone
Xatta-Trone / dropbox-php-auth.md
Created September 26, 2023 21:32 — forked from phuze/dropbox-php-auth.md
Dropbox API V2: PHP Authentication Process

Effective September 2021, Dropbox will be deprecating long-lived access tokens.

This GIST generally describes how to authenticate requests to Dropbox API v2, for anyone working on a server-side PHP Dropbox implementation.

It's important to understand three types of codes you'll encounter:

  1. Access Code - this is a one-time code that represents user-granted app access.
  2. Access Token - this is short-lived token that provides access to Dropbox API endpoints.
  3. Refresh Token - this is a long-lived token that allows you to fetch a fresh Access Token.
@Xatta-Trone
Xatta-Trone / Test Driven Laravel.md
Created October 12, 2022 06:42 — forked from Pen-y-Fan/Test Driven Laravel.md
Test Driven Laravel
@Xatta-Trone
Xatta-Trone / .htaccess
Created September 29, 2022 13:49 — forked from davemackintosh/.htaccess
Working .htaccess for Single Page Apps
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.html [QSA,L]
</ifModule>
@Xatta-Trone
Xatta-Trone / echo.json
Created July 10, 2020 10:09
laravel-echo-server using pm2 || pm2 start echo.json
{
"name": "echo",
"script": "laravel-echo-server",
"args": "start"
}
@Xatta-Trone
Xatta-Trone / laravel-queue-worker.yml
Created July 10, 2020 10:07
laravel queue worker pm2 || pm2 start laravel-queue-worker.yml
apps:
- name: laravel-queue-worker
script: artisan
exec_mode: fork
interpreter: php
instances: 1
args:
- queue:work
- --tries=5
- --sleep=1
@Xatta-Trone
Xatta-Trone / corn_job_laravel.php
Created October 2, 2019 16:25
This gist can be used for running corn job in laravel
cd /home/<username>/domains/<domain_name>/public_html/<folderpath>/; /usr/local/bin/php artisan <command> >/dev/null 2>&1
// corn job for direct admin laravel
@Xatta-Trone
Xatta-Trone / remove_public_from_laravel.php
Created October 1, 2019 17:16
Paste this code into your root directory of your laravel project inside the .htaccess file
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
<?php
//User Class e eita ase
public function UpdatePdfData($pdfId){
$query = "SELECT * FROM table_pdf WHERE id='$pdfId'";
$downloadresult = $this->db->select($query);
if ($downloadresult) {
while ($downloadCount = $downloadresult->fetch_assoc()) {
$download = (int)$downloadCount['download'] + 1;