Skip to content

Instantly share code, notes, and snippets.

View tylerforesthauser's full-sized avatar

Tyler Forest-Hauser tylerforesthauser

View GitHub Profile
#!/usr/bin/perl
# Perl script to add rTorrent fast resume data to torrent files.
# Original URL: https://github.com/lethanhviet/autoExport/blob/master/rtorrent_fast_resume.pl
#
# Usage:
# rtorrent_fast_resume.pl [base-directory] < plain.torrent > with_fast_resume.torrent
use warnings;
use strict;
@tylerforesthauser
tylerforesthauser / filebot-installer.sh
Last active December 2, 2019 16:05
Filebot Installer for USB
#!/bin/sh -xu
# Based on the official tar installer: https://raw.githubusercontent.com/filebot/plugins/master/installer/tar.sh
PACKAGE_VERSION=4.8.5
PACKAGE_SHA256=$(curl -fsSL https://raw.githubusercontent.com/filebot/website/master/get.filebot.net/filebot/FileBot_$PACKAGE_VERSION/FileBot_$PACKAGE_VERSION-portable.tar.xz.sha256)
PACKAGE_FILE=FileBot_$PACKAGE_VERSION-portable.tar.xz
PACKAGE_URL=https://get.filebot.net/filebot/FileBot_$PACKAGE_VERSION/$PACKAGE_FILE
# Download latest portable package
@tylerforesthauser
tylerforesthauser / raise-dark.min.css
Created June 7, 2019 20:06
Custom PTP Stylesheet
@charset "UTF-8";@import url(https://fonts.googleapis.com/css?family=Material+Icons);@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,700);@import url(https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700);@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700);#morecast:before,#toggle_add_similar_movies:before,#toggleaddtags:before{font-family:'Roboto'}.discuss:before,.panel__heading__toggler:before,.toggle:before{-webkit-transition:color .1s ease-out;-o-transition:color .1s ease-out;transition:color .1s ease-out}#content:after,.clearfix:after,.forum-post__buttons:after,.forum-post__heading:after,.huge-movie-list__movie:after,.qtip-content:after,.thin:after,.user-recommendation:after{content:"";display:block;clear:both}#nav_bonus a,#userinfo_minor,#userinfo_username,.bvalidator_errmsg,.page__title~.linkbox:first-of-type,.qtip,.simplemodal-data,.user-info-bar__drop-down-menu,body#bprate .linkbox,body#requests .page__title~.linkbox:first-of-type:not(:la
@tylerforesthauser
tylerforesthauser / Custom SearchController
Created November 8, 2013 06:04
Custom Search Controller for product sorting capability.
<?php
/**
* Custom Search controller
*
* Used for both general browsing from categories, as well as specific searches
*
*
*/
class SearchController extends Controller
@tylerforesthauser
tylerforesthauser / LightSpeed Web Store 3 - "Featured" Product Slider
Last active December 26, 2015 16:09
Used to grab products in an array based on a chosen Web Keyword. Currently set to use with bxSlider. List generated currently with TbThumbnails widget (I would love to use CListView, instead).
@tylerforesthauser
tylerforesthauser / LightSpeed Web Store 3 - Display Category Parent on Product Listing
Created October 27, 2013 03:37
Used to display current category's immediate parent on Product Listing pages.
<?php
$strC = Yii::app()->getRequest()->getQuery('cat');
$objCategory = Category::LoadByRequestUrl($strC);
?>
<?= ($objCategory->Parent) ? '<h2>'.$objCategory->Parent->label.'</h2>' : '' ?>
@tylerforesthauser
tylerforesthauser / LightSpeed Web Store 3 - Sale Formatting based on Keyword
Last active December 26, 2015 16:08
Used to show "Sale"-related content/formatting based on Product Keyword
<?php
$tags = CHtml::listData($data->productTags,'tag.tag','tag.tag');
if (!function_exists('in_arrayi')) {
function in_arrayi($needle, $haystack) {
return in_array(strtolower($needle), array_map('strtolower', $haystack));
}}
?>
<?= (in_arrayi('sale',$tags)) ? '<div class="sale-tag btn-primary"><span>SALE</span></div>' : '' ?>