Skip to content

Instantly share code, notes, and snippets.

View mackhankins's full-sized avatar
🏠
Working from home

Mack Hankins mackhankins

🏠
Working from home
  • Jackson, MS, USA
View GitHub Profile
@mackhankins
mackhankins / temporary_media_radarr.py
Created March 11, 2024 22:24
Temporary Media Radarr
from pyarr.radarr import RadarrAPI
from datetime import datetime, timedelta
# Radarr API URL and API key
RADARR_URL = "http://radarr_url:port"
API_KEY = "your_api_key"
# Number of days to keep items before deletion
DAYS_TO_KEEP = 30 # Change this as needed
@mackhankins
mackhankins / temporary_media_sonarr.py
Created March 11, 2024 18:59
Temporary Media Sonarr
from pyarr.sonarr import SonarrAPI
from datetime import datetime, timedelta
# Sonarr API URL and API key
SONARR_URL = "http://sonarr_url:port"
API_KEY = "your_api_key"
# Number of days to keep items before deletion
DAYS_TO_KEEP = 30 # Change this as needed
@mackhankins
mackhankins / theme.css
Last active September 28, 2023 20:32
Custom Filament v3 Color Scheme
.dark {
.fi-body {
background: #111827 !important;
}
}
.dark {
.fi-wi-stats-overview-stat, .fi-ta-ctn, .fi-section,
& nav:not(.fi-sidebar-nav):not(.fi-breadcrumbs), .fi-sidebar-header,
.fi-dropdown-panel, .fi-modal-window, .tiptap-prosemirror-wrapper,
@mackhankins
mackhankins / ScoutMacroServiceProvider.php
Created August 29, 2019 17:36
Laravel Scout Elastic whereIn Macro
<?php
namespace App\Providers;
use Laravel\Scout\Builder;
use Illuminate\Support\ServiceProvider;
class ScoutMacroServiceProvider extends ServiceProvider
{
/**
@mackhankins
mackhankins / mac-install.md
Last active July 18, 2016 13:30
Auto Updating Pokemon Go Map
  1. You need to install python and pip. You can Google your way through that part of it.
  2. Next, open up terminal and clone the repository. git clone https://github.com/memelyfe/pokemongo-api-demo.git to your home directory. I assume you're terminal opens up there, but maybe cd ~ if not.
  3. cd ~/pokemongo-api-demo
  4. git checkout maps
  5. pip install -r requirements.txt
  6. Now we need an api key for Google Maps Javascript Library. I'm not going to walk you through this whole process, but you start at https://console.developers.google.com/ by creating a new project. Then, enabling the API you need.
  7. Once you have the api key, back to terminal nano ~/pokemongo-api-demo/config.json and enter the api key where it tells you. cntrl+O to save;
  8. Whew, next get your current coordinates from your choice, but here's one. https://whereamirightnow.com/. I prefer this over using a city/state, but you can also do that.
  9. Be sure to have your Pokemon Trainer Club login handy. I don't think it works
@mackhankins
mackhankins / ExtendValidationServiceProvider.php
Created July 14, 2016 22:55
Begins With Custom Validator for Laravel
//Great for validating twitter / telegra usernames ('telegram' => 'begins_with:@')
$this->app['validator']->extend('begins_with', function($attribute, $value, $parameters, $validator) use ($zipCode) {
return $value[0] == $parameters[0];
});
@mackhankins
mackhankins / Hashtag.php
Created June 28, 2016 00:31
Hashtag Tweets
<?php
function getTweets($hash_tag) {
$url = 'http://search.twitter.com/search.atom?q='.urlencode($hash_tag) ;
echo "<p>Connecting to <strong>$url</strong> ...</p>";
$ch = curl_init($url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
$xml = curl_exec ($ch);
curl_close ($ch);
@mackhankins
mackhankins / laravel-chartjs.md
Created April 12, 2016 21:40
laravel-chartjs

None of this is production code, but me trying to figure out how to work multiple datasets into a Laravel project with chartjs. Here's my table schema

        Schema::create('statistics', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->string('type');
            $table->string('table');
            $table->integer('count');
            $table->timestamps();
        });
@mackhankins
mackhankins / VagrantFile
Last active April 5, 2017 13:51
Vaprobash Windows Vagrant with NFS false
# first you should try the NFS vagrant plugin (https://github.com/fideloper/Vaprobash/issues/146)
# Below is another option if that doesn't work.
# Use NFS for the shared folder
config.vm.synced_folder ".", "/vagrant",
id: "core",
:nfs => false,
:mount_options => ["dmode=777", "fmode=777"]