Skip to content

Instantly share code, notes, and snippets.

@rossdargan
rossdargan / removecompletedtorrents.sh
Last active April 21, 2022 08:57 — forked from root-hal9000/removecompletedtorrents.sh
Transmission-Daemon: Remove Completed Torrents
#!/bin/bash
# script to check for complete torrents in transmission folder.
USER=Username here
PASS=password here
PROCESSING_FOLDER="/data/completed/process"
CUTOFF_EPOCH=`date -d "15 days ago" +%s`
# use transmission-remote to get torrent list from transmission-remote list
# use sed to delete first / last line of output, and remove leading spaces
# use cut to get first field from each line
TORRENTLIST=`transmission-remote -n $USER:$PASS --list | sed -e '1d;$d;s/^ *//' | cut --only-delimited -d ' ' --fields=1`
## my test
async def test_setup_platform(hass, config_entry, config):
await setup_platform(hass, SWITCH_DOMAIN, config)
entity_registry = await hass.helpers.entity_registry.async_get_registry()
entry = entity_registry.async_get("switch.front_door_siren")
assert entry
## conftest.py
public WeakReference Reference;
public override void ViewDidLoad()
{
base.ViewDidLoad();
float y = 30;
View.BackgroundColor = UIColor.White;
// The image we will work with; we derive our own so we can see
// it get destroyed.
class AsyncCommand : ICommand
{
private readonly Func<Task> asyncAction;
private bool isRunning = false;
public bool IsRunning
{
get { return isRunning; }
set
{
@rossdargan
rossdargan / gist:5357985
Created April 10, 2013 20:06
Control PacMan
PacManManager manager = new PacManManager(ComPort.Text);
manager.DoCommand(PacManManager.Command.Blue);
@rossdargan
rossdargan / gist:5357928
Created April 10, 2013 19:59
A program to control a PacMan remote control
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PacMan.Lib
{