Skip to content

Instantly share code, notes, and snippets.

View jrdnrc's full-sized avatar
💥
💥

Jordan Crocker jrdnrc

💥
💥
View GitHub Profile
// Step 1: Get an API key here: https://developers.google.com/url-shortener/v1/getting_started#APIKey
// Step 2: Paste your api key below
// Step 3: Add the code below to your browser as a bookmark
// Step 4: Visit a non-goo.gl URL and click your bookmark
// NOTE: The security policy of some sites (such as this gist.github.com!) will prevent this from working.
// Check your javascript console if something doesn't work.
javascript:(function(){
var googleApiKey = 'INSERT YOUR API KEY HERE';
@jrdnrc
jrdnrc / .php_cs
Created May 16, 2018 08:55 — forked from petericebear/.php_cs
Laravel 5.x php-cs-fixer config file
<?php
$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/cache')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
<?php declare(strict_types=1);
namespace App\Laravel\Providers;
use Illuminate\Support\ServiceProvider;
/**
* Class PaperTrailServiceProvider
* @package App\Laravel\Providers
* @author jrdn
<?php declare(strict_types = 1);
namespace JrdnRc\FplChecker\Laravel\Http\Controllers\OAuth;
use JrdnRc\FplChecker\Laravel\Http\Controllers\Controller;
use Laravel\Socialite\Contracts\Provider;
use Symfony\Component\HttpFoundation\Response;
final class AuthenticateViaGoogle extends Controller
{
@jrdnrc
jrdnrc / parser.php
Last active March 22, 2017 09:21
Parsing
<?php declare(strict_types = 1);
use PhpMimeMailParser\Parser;
$raw = base64_decode($switched);
$parser = (new Parser)->setText($raw);
$parser->getMessageBody('html'); // get body in HTML format
$parser->getMessageBody('text'); // get plain text body
@jrdnrc
jrdnrc / decode.php
Last active March 22, 2017 08:46
Decoder
<?php declare(strict_types = 1);
$switched = str_replace(['-', '_'], ['+', '/'], $raw);
@jrdnrc
jrdnrc / retrieve.php
Last active March 22, 2017 09:12
Retrieving a message
<?php declare(strict_types = 1);
// assuming Google_Client is already configured, and assigned to $client
// $currentUser is the currently authenticated user
$gmail = new Google_Service_Gmail($client);
$googleUserId = $currentUser->getGoogleId();
$response = $gmail->users_messages->listUsersMessages(
$googleUserId,
@jrdnrc
jrdnrc / PerformAction.php
Created March 10, 2017 10:32
Invokable Controllers
<?php declare(strict_types = 1);
namespace App\Http\Controllers\Api;
use App\CommandBus;
use App\Commands\LogRequest;
use App\Http\Requests\Api\LogCoinbaseNotification;
use Symfony\Component\HttpFoundation\Response;
/**
==> salarycheckerapi: Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install libbz2-dev' returned 100: Reading package lists...
==> salarycheckerapi: Building dependency tree...
==> salarycheckerapi: Reading state information...
==> salarycheckerapi: The following NEW packages will be installed:
==> salarycheckerapi: libbz2-dev
==> salarycheckerapi: 0 upgraded, 1 newly installed, 0 to remove and 110 not upgraded.
==> salarycheckerapi: Need to get 33.2 kB of archives.
==> salarycheckerapi: After this operation, 117 kB of additional disk space will be used.
==> salarycheckerapi: Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/main libbz2-dev amd64 1.0.6-5 [33.2 kB]
==> salarycheckerapi: Fetched 33.2 kB in 0s (101 kB/s)
@jrdnrc
jrdnrc / keybase.md
Last active March 10, 2017 17:25
keybase.md

Keybase proof

I hereby claim:

  • I am jrdnrc on github.
  • I am jrdn (https://keybase.io/jrdn) on keybase.
  • I have a public key ASA2UD0bBnuAYEsPulBzyDfAiDxchWMDqHJ5pV7mYxYJKwo

To claim this, I am signing this object: