Skip to content

Instantly share code, notes, and snippets.

View causefx's full-sized avatar

causefx

  • States that are United
View GitHub Profile
@xeoncross
xeoncross / timezone.php
Created September 8, 2011 18:43
The perfect TimeZone selectbox list for PHP 5.3+
<?php
$regions = array(
'Africa' => DateTimeZone::AFRICA,
'America' => DateTimeZone::AMERICA,
'Antarctica' => DateTimeZone::ANTARCTICA,
'Aisa' => DateTimeZone::ASIA,
'Atlantic' => DateTimeZone::ATLANTIC,
'Europe' => DateTimeZone::EUROPE,
'Indian' => DateTimeZone::INDIAN,
'Pacific' => DateTimeZone::PACIFIC
@stormchasing
stormchasing / Auto Check-In to Southwest Flights.user.js
Last active October 13, 2024 19:49
Auto Check-In to Southwest Flights.user.js
// ==UserScript==
// @name Auto Check-In to Southwest Flights
// @namespace http://www.ryanizzo.com/southwest-auto-check-in/
// @version 1.8
// @author Nicholas Buroojy (http://userscripts.org/users/83813)
// @contributor Ryan Izzo (http://www.ryanizzo.com)
// @contributor JR Hehnly (http://www.okstorms.com @stormchasing)
// @contributor Trevor McClellan (github.com/trevormcclellan)
// @description Automatically check in to Southwest Airline flights at the appropriate time.
// @include https://www.southwest.com/air/check-in/index.html*
@nathanbrauer
nathanbrauer / non-static.php
Last active May 18, 2022 03:03
Ways to alias a method on a class.
<?php
/**
* Ways to alias a method on a class.
*
* Methods are in order of least preferred (top) to most preferred (bottom). Code style, not performance, is taken into account.
*/
Class Program {
const SECONDS = 1;
const MICROSECONDS = 2;
function setWeatherIcon(condid) {
var icon = '';
switch(condid) {
case '0': icon = 'wi-tornado';
break;
case '1': icon = 'wi-storm-showers';
break;
case '2': icon = 'wi-tornado';
break;
case '3': icon = 'wi-thunderstorm';
@ehvanr
ehvanr / ban_dupes.py
Last active May 2, 2018 14:17
Duplicate User Plex IPTables Drop Rule
#!/usr/bin/env python
# DESCRIPTION:
#
# This script is meant to be run as a root cronjob. You can run it however frequently
# you desire - I run it every minute. It determines the number of streams, and cross
# references the usernames. If there are duplicate usernames, it checks if the IP
# addresses are different. If so, it generates IPTables rules that will drop packets
# from both IP addresses.
#
@blacktwin
blacktwin / stream_limiter_ban_email.py
Last active October 27, 2020 21:33
This is indented to restrict a user to the LIMIT amount of concurrent streams. User will be warned, punished, and banned completely if violations continue.
"""
Share functions from https://gist.github.com/JonnyWong16/f8139216e2748cb367558070c1448636
Once user stream count hits LIMIT they are unshared from libraries expect for banned library.
Once user stream count is below LIMIT and banned library video is watched their shares are restored.
Once violation count have been reached ban permanently.
Caveats:
Unsharing doesn't pause the stream.
After unsharing user can pause but not skip ahead or skip back.
@Birdie0
Birdie0 / ifttt-webhooks-extended-guide.md
Last active November 1, 2024 08:43
How to use Discord Webhooks

⚠️ This gist is no longer updated! For maintained, improved and even more extended guide click here.


How to use Discord Webhook

It's a JSON

First, learn JSON. It's not programming language, not even close. Just follow syntax rules and you will be fine.

@fryfrog
fryfrog / sonarr_cleanup_packed_torrent.sh
Last active April 13, 2024 11:06
A Sonarr post processing script to remove the video file from packed torrents, modified version of subzero79/87a347a07964390884c9
#!/bin/bash
# Examples for testing
# sonarr_episodefile_sourcefolder="/data/torrent/tv/Penny.Dreadful.S01E01.720p.HDTV.x264-2HD" sonarr_episodefile_sourcepath="/data/torrent/tv/Penny.Dreadful.S01E01.720p.HDTV.x264-2HD/penny.dreadful.s01e01.720p.hdtv.x264-2hd.mkv"
# Instructions
# Put this script somewhere on your file system like /usr/local/bin and make it executable.
#
# In Sonarr, Settings -> Connect add a Custom Script
# On Grab: No
<?php
namespace App\Charts;
use App\Support\Livewire\ChartComponentData;
use ConsoleTVs\Charts\Classes\Chartjs\Chart;
/**
* Class WanSpeedTestsChart
*
@codebykyle
codebykyle / connect.ps1
Last active October 14, 2024 19:04
Windows Terminal Split Pane Powershell Script - v2
using namespace System.Collections.Generic
# Encapsulate an arbitrary command
class PaneCommand {
[string]$Command
PaneCommand() {
$this.Command = "";
}