Skip to content

Instantly share code, notes, and snippets.

View 4handheld's full-sized avatar
👨‍💻
Open to exciting opportunities

Joseph 4handheld

👨‍💻
Open to exciting opportunities
  • Remote
View GitHub Profile
@4handheld
4handheld / SMSPermissionFragment.kt
Created January 5, 2022 06:47
A samplebuild.gradle file for an android module that requires the androidx.activity:activity dependency & a sample fragment that's utilizing the ActivityResultLauncher
package sample.test.permission
import android.Manifest
import android.app.PendingIntent
import android.os.Bundle
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts.RequestMultiplePermissions
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider
import sample.test.permission.R
package ninja.zilles.matchmaker;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
web: vendor/bin/heroku-php-apache2 public/
<html>
<head>
</head>
<body>
<script src="https://gist.githubusercontent.com/4handheld/6c4fee5cfc971d5e7c442aeff3ddc539/raw/262bdd7f6eddb07d5277f0b49c59d8a864c0cda4/xssalert.js">
</script>
</body>
<html>
alert()
public function handle($request, Closure $next)
{
$response = $next($request);
$response->header('Access-Control-Allow-Methods', 'POST, GET, OPTIONS, HEAD, PUT, PATCH, DELETE');
$response->header('Access-Control-Allow-Headers', $request->header('Access-Control-Request-Headers'));
$response->header('Access-Control-Allow-Origin', '*');
return $response;
// $response = $next($request);
@4handheld
4handheld / tags.php
Created May 23, 2019 03:17
The tags indicating the api groups
<?php
/**
* @OA\Tag(
* name="greeting",
* description="Sample package to test out the greeting APIs",
* )
**/
?>
<?php
class SampleController //This is a sample laravel Controller
{
/**
* @OA\GET(
* path="/api/greet",
* tags={"greeting"},
* summary="Returns a Sample API response",
* description="A sample greeting to test out the API",
* operationId="sampleFunctionWithDoc",
<?php
/**
* @OA\Info(
* description="This is a sample API Documentation",
* version="1.0.0",
* title="Sample App API swagger documentation",
* termsOfService="http://swagger.io/terms/",
* @OA\Contact(
* email="apiteam@swagger.io"
* ),