This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code sample demonstrating use of Rust-style Result for an API Service in Angular + Typescript | |
// Posted: 2023-07-24 | |
// Paul Barton | |
// Released to the public domain | |
import { Injectable } from '@angular/core'; | |
import { environment } from '../environments/environment'; | |
import { | |
HttpClient, | |
HttpErrorResponse, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
A little script to automatically update my 'home' subdomain on A2 Hosting. No API | |
access so I implemented it with Selenium. Very simple now, might become more elaborate | |
later is needed. | |
""" | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import functools | |
class Router(object): | |
def __init__(self, n): | |
self.serial_queue = asyncio.Queue() | |
self.n = n | |
async def serial_executor(self): | |
count = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
#Bandcamp filenames look like "<ARTIST> - <ALBUM> - ## TRACKNAME.flac" | |
old_names = [fn for fn in os.listdir('.') if os.path.splitext(fn)[1] == '.flac'] | |
new_names = [] | |
for name in old_names: | |
new_name = name.split(' - ', 2)[2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Steps: | |
# sudo apt-get install libomxil-bellagio-dev | |
# install some other stuff, here's at least a partial list | |
# sudo apt-get install libopus-dev libvorbis-dev libx264-dev libx265-dev | |
# libtheora-dev libvpx-dev libzvbi-dev libmp3lame-dev libass-dev | |
# | |
# git clone https://github.com/FFmpeg/FFmpeg.git | |
# cd FFmpeg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
capture.py - A script to capture video and manage transfer of video data | |
Still in early stages of development and rapidly evolving to meet our needs. It | |
is partly a wrapper for raspivid, which it deploys. | |
Usage: | |
capture.py [options] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import matplotlib.pyplot as plt | |
a = 0 # Window minimum in x | |
b = 2 # Window maximum in x | |
c = 4 # Window maximum in y | |
my_df = lambda x : x ** 2 | |
def rejection(f, x, y): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Dashify | |
Usage: | |
dashify <input> [options] <output-dir> | |
dashify (-h | --help) | |
dashify --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Concat - a tool for efficiently concatenating video inputs and combining with | |
an audio file | |
Usage: | |
concat <json-input> [options] <output> | |
concat (-h | --help) | |
concat --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Concat - a tool for efficiently concatenating video inputs and combining with | |
an audio file | |
Usage: | |
concat <json-input> [options] <output> | |
concat (-h | --help) | |
concat --version |
NewerOlder