Skip to content

Instantly share code, notes, and snippets.

View paulresdat's full-sized avatar

Paul Carlton paulresdat

  • Resource Data Inc
  • Anchorage
View GitHub Profile
@paulresdat
paulresdat / bandamp-repeat.js
Last active April 8, 2024 22:39
Repeat a track without having to push play over and over again
class BandcampPlay {
constructor() {
}
#interval = null;
repeatAll() {
var self = this;
@paulresdat
paulresdat / line-count.py
Created March 29, 2024 23:07
An easy line count that has the ability to quickly add languages
import argparse
from enum import Enum
from os.path import abspath
from glob import glob
from io import TextIOWrapper
import pathlib
from typing import List, Pattern, AnyStr
import inspect
import re
from abc import ABCMeta, abstractmethod
mv subfolder subfolder_tmp
git submodule deinit subfolder
git rm --cached subfolder
mv subfolder_tmp subfolder
git add subfolder
@paulresdat
paulresdat / servicecollection.dart
Last active November 8, 2021 17:03
C# style service collection in dart
enum ServiceMetaDataType {
singleton,
transient,
}
class ServiceMetaData<T> {
late dynamic _instanceFunc;
T? _instance;
late final List<String> _dependencies;
late final ServiceMetaDataType _serviceType;
## README
# This is the only file needed if you are working off of zsh
# and have Oh-my-zsh installed.
git-diff() {
correct=$(git diff 2>&1)
if [[ $correct = *"Not a git repository"* ]]; then
echo $correct
return
fi
@paulresdat
paulresdat / events.dart
Last active October 26, 2020 03:50
Event Handling in Dart
Type typeof<T>() => T;
typedef void DelegateHandler<T>(T response);
abstract class IHandler {
void run(dynamic response);
bool isType<T>(T type);
dynamic get();
}
class Handler<T> implements IHandler {
#!/bin/bash
# this is just a quick script I created in bash to install and backup vsts that aren't installable
# ie you have to manually put them into the VST and Components folders, easier to just go the folder via
# the terminal and run this rather than go and find the folder and copy paste over
#/Volumes/LaCie/documents/Keep/VST-MANUAL
#/Library/Audio/Plug-Ins/VST
#/Library/Audio/Plug-Ins/Components
# install vsts
@paulresdat
paulresdat / git-shortcuts.sh
Last active August 1, 2019 21:54
Handy automated bash commands for git
#!/usr/bin/bash
git-diff() {
correct=$(git diff 2>&1)
if [[ $correct = *"Not a git repository"* ]]; then
echo $correct
return
fi
if [ $# -eq 0 ]; then
@paulresdat
paulresdat / automate-build.js
Last active April 26, 2018 17:57
ALVIN on jenkins: automates building when random unit test failures keep happening on a branch
(function($) {
var timeSet = 0;
var count = 0;
var log = false;
function check()
{
setTimeout(function() {
timeSet = 10000;
var title = $('img', $('a', $('table'))).attr('title');
if (title == 'Success > Console Output') {