Skip to content

Instantly share code, notes, and snippets.

View Dan6erbond's full-sized avatar
Building blockchain projects.

RaviAnand Mohabir Dan6erbond

Building blockchain projects.
View GitHub Profile
@Dan6erbond
Dan6erbond / FileHandlerGetSubFolders.java
Last active June 3, 2019 10:58
A simple method to get all the sub-folders within another folder in Java.
public static ArrayList<File> getSubFolders(File folder) {
File[] dirs = {folder};
ArrayList<File> directories = new ArrayList<>(Arrays.asList(dirs));
File[] fs = {folder};
ArrayList<File> folders = new ArrayList<>(Arrays.asList(fs));
while (folders.size() > 0){
ArrayList<File> remove = new ArrayList<>();
ArrayList<File> add = new ArrayList<>();
@Dan6erbond
Dan6erbond / aPRAWDiscordStream.py
Last active June 21, 2020 17:54
Discord bot layout to fetch new comments and post them to a desired location based on Banhammer.py's design and aPRAW.
from discord.ext import commands
import apraw
# instatiate a `Bot` instance
# this is using the Discord.py library
# source can be found here: https://github.com/Rapptz/discord.py
bot = commands.Bot(COMMAND_PREFIX, description=DESCRIPTION)
# instantiate a `Reddit` instance
# you can also supply a key to an entry within a praw.ini
@Dan6erbond
Dan6erbond / DonorAssignment.py
Created July 9, 2020 08:37
A Python exercise focused on multidimensional lists.
def main():
print("Input the folowing data for the donor:")
donors = list() # 'columns represent name, address, contact'
# get information for three donors
for i in range(3):
# ask for donor information and store in temporary variables
first_name = input('First name: ')
address = input('Address: ')
@Dan6erbond
Dan6erbond / settings.jsonc
Last active September 11, 2020 08:58
Windows Terminal Settings
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@Dan6erbond
Dan6erbond / merge.ts
Last active August 31, 2020 17:05
A TypeScript array merger that reads updates from last known store state, updated local state and updated remote state.
function mergeArrays<T>(
oldCollection: T[],
updatedCollection: T[],
remoteCollection: T[],
uniqueIdentifier: (item: T) => string | number
) {
const oldIds = oldCollection.map((i) => uniqueIdentifier(i));
const updatedIds = updatedCollection.map((i) => uniqueIdentifier(i));
const remoteIds = remoteCollection.map((i) => uniqueIdentifier(i));
@Dan6erbond
Dan6erbond / time.py
Last active September 10, 2020 11:45
A Python script to parse various time formats specifying duration.
import cProfile
import random
import re
units = {
"days": {
"seconds": 60 * 60 * 24,
"aliases": ["d"],
},
"hours": {
@Dan6erbond
Dan6erbond / autolina.js
Last active September 25, 2020 07:06
Tampermonkey user scripts to convert car listings to Sheets columns.
// ==UserScript==
// @name Autolina
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Convert Autolina car listings to Sheets columns.
// @author Dan6erbond
// @match https://www.autolina.ch*auto/*
// @grant none
// ==/UserScript==
@Dan6erbond
Dan6erbond / 0PluginLibrary.plugin.js
Last active January 1, 2024 15:17
A collection of useful Better Discord themes and plugins.
/**
* @name ZeresPluginLibrary
* @version 1.2.32
* @invite TyFxKer
* @authorLink https://twitter.com/ZackRauen
* @donate https://paypal.me/ZackRauen
* @patreon https://patreon.com/Zerebos
* @website https://github.com/rauenzi/BDPluginLibrary
* @source https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js
*/
@Dan6erbond
Dan6erbond / moviebot.py
Last active January 3, 2023 12:11
Organizarr
import os
import sys
import PTN
import requests
from dotenv import load_dotenv
from sanitize_filename import sanitize
load_dotenv()
@Dan6erbond
Dan6erbond / services.yaml
Created January 3, 2023 11:45
Homepage Configs
- "Admin":
- "Grafana":
"href": "https://grafana.example.com"
"icon": "grafana.png"
- "Traefik":
"href": "https://traefik.example.com"
"icon": "traefik.png"
"widget":
"type": "traefik"
"url": "https://traefik.example.com"