Skip to content

Instantly share code, notes, and snippets.

Refer Link: https://any-api.com/
@Hothi-Jimit
Hothi-Jimit / sublime-keymap
Created August 5, 2019 11:04
A list of sublime packages that i installed and sublime setting
[
{
"keys": [
"tab"
],
"command": "expand_abbreviation_by_tab",
"context": [
{
"operand": "source.js",
"operator": "equal",
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJibG9nLmRldiIsInN1YiI6IjU5YWEyYTQ3ZjlkYzQxMTU3ODAwNjM0NiIsImlhdCI6MTUwNDYwNTY1MiwiZXhwIjoxNTA0NjA5MjUyfQ.F-7q5gR7TnLFaHxKhOiacgPlOzAYGgQ1lu5mZ_WWnqI"
}
@Hothi-Jimit
Hothi-Jimit / JwtMiddleware.php
Created August 5, 2019 11:02
JWT Middleware
<?php
namespace App\Http\Middleware;
use Closure;
use Exception;
use App\User;
use Firebase\JWT\JWT;
use Firebase\JWT\ExpiredException;
@Hothi-Jimit
Hothi-Jimit / .env
Created August 5, 2019 11:01
JWT authentication for Lumen 5.6
APP_ENV=local
APP_DEBUG=true
APP_KEY=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
CACHE_DRIVER=file
@Hothi-Jimit
Hothi-Jimit / AuthController.php
Created August 5, 2019 10:59
JWT authentication for Lumen 5.6
<?php
namespace App\Http\Controllers;
use Validator;
use App\User;
use Firebase\JWT\JWT;
use Illuminate\Http\Request;
use Firebase\JWT\ExpiredException;
use Illuminate\Support\Facades\Hash;
@Hothi-Jimit
Hothi-Jimit / mail.php
Created July 19, 2019 07:36 — forked from kaplanmaxe/mail.php
PHP Recaptcha PHP tutorial
<?php
$sender_name = stripslashes($_POST["sender_name"]);
$sender_email = stripslashes($_POST["sender_email"]);
$sender_message = stripslashes($_POST["sender_message"]);
$response = $_POST["g-recaptcha-response"];
$url = 'https://www.google.com/recaptcha/api/siteverify';
$data = array(
'secret' => 'YOUR_SECRET',
'response' => $_POST["g-recaptcha-response"]
@Hothi-Jimit
Hothi-Jimit / custom image validation in codeigniter
Created July 19, 2019 07:10
custom image validation in codeigniter
$this->form_validation->set_rules ( 'featured_image', 'Blog Image', 'callback_image_required_validation' );
/**
* This method used for image required validation.
*
* @return boolean
*/
function image_required_validation() {
$allowed_mime_type_arr = array (
'image/gif',
@Hothi-Jimit
Hothi-Jimit / .htaccess
Created June 10, 2019 04:50 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@Hothi-Jimit
Hothi-Jimit / json-to-csv.php
Created May 7, 2019 10:37 — forked from Kostanos/json-to-csv.php
Convert JSON array file to CSV. Use the array keys as the first row. Command line using: json-to-csv.php json.filename > csv.filename
#!/usr/bin/php
<?php
/*
* Convert JSON file to CSV and output it.
*
* JSON should be an array of objects, dictionaries with simple data structure
* and the same keys in each object.
* The order of keys it took from the first element.
*
* Example: