Skip to content

Instantly share code, notes, and snippets.

View codeInBit's full-sized avatar

Olanrewaju Abidogun codeInBit

View GitHub Profile
@codeInBit
codeInBit / cloudSettings
Last active July 18, 2022 16:37
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-09-12T12:37:55.342Z","extensionVersion":"v3.4.3"}
@codeInBit
codeInBit / Response.php
Created July 30, 2021 08:41 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@codeInBit
codeInBit / csv_to_array.php
Created November 22, 2018 12:50 — forked from jaywilliams/csv_to_array.php
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
/**
* Redirect the User to Paystack / Paypal Payment Page
* @param Request $request
* @return URL
*/
public function redirectToGateway(Request $request)
{
//Check if user is logged in
if(Auth::check()){
//Check if the subscription for Professional Plan
@codeInBit
codeInBit / EnsureQueueListenerIsRunning.php
Created November 17, 2017 11:12 — forked from ivanvermeyen/EnsureQueueListenerIsRunning.php
Ensure that the Laravel 5.1 queue listener is running with "php artisan queue:checkup" and restart it if necessary. You can run this automatically with a cron job: http://laravel.com/docs/scheduling
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class EnsureQueueListenerIsRunning extends Command
{
/**
* The name and signature of the console command.
public static function upload(UploadedFile $file)
{
$fileMedia = new static;
$file->name = time().'_'. strtolower( $file->getClientOriginalName() );
Image::make($file)->resize(1360, 760)->save(config('admin.fileUploadDirectory') . $file->name);
// $file->move(config('admin.fileUploadDirectory'), $file->name);
return $file;
@extends('layouts.app')
@section('content')
<div class="container auth">
<div class="row">
<div class="col-md-12">
<div class="auth-heading">
<h4 class="text-center" style="color:rgba(0, 0, 0, 1)"><strong>ALL CASES</strong></h4>
<h5 class="text-center" style="color:rgba(0, 0, 0, 1)">List of all cases and Timeline for each</h5>
{
"result": 200,
"message": "Messages were sent successfully",
"transaction_code":"892893892893"
}
$api = "http://push.cellcore.com.ng/api/v1/push";
$header = array(
'Authorization' => "API_KEY"
);
$params = array(
'type' => "txt",
'payload' => "Thanks for choosing Push It....",
'group_msg'=>"1",
@codeInBit
codeInBit / Replace Current Intent
Created February 9, 2017 08:10
Below snippet helps replace current intent to deliver new extras from notification if the app is currently running
@Override
protected void onNewIntent(Intent intent) {
//needed to receive a new intent in case the activity is already running when message arrives
setIntent(intent);
super.onNewIntent(intent);
}