Skip to content

Instantly share code, notes, and snippets.

View Node0's full-sized avatar

Node0 (Joe) Node0

View GitHub Profile
@Node0
Node0 / Download_ChatGPT_convo_in_markdown.js
Created April 5, 2023 22:53
A tampermonkey script that inserts a download button which formats the current chat into markdown and then downloads the MD file to your computer.
// ==UserScript==
// @name Download ChatGPT Convo in Markdown
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Adds a download chat button to download the current chatGPT conversation in markdown format. Original MD processing code by: u/Creative_Original918 from Reddit. Code from the following thread: https://www.reddit.com/user/Creative_Original918/ https://www.reddit.com/r/ChatGPT/comments/zm237o/comment/jdjwyyo/?utm_source=share&utm_medium=web2x&context=3
// @author https://github.com/node0 and https://www.reddit.com/user/Creative_Original918/
// @match https://chat.openai.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=openai.com
// @grant none
// ==/UserScript==
@Node0
Node0 / Joe_and_chatGPT3-5_conversation_about_monads.md
Created March 22, 2023 21:13
Conversation with Chat-GPT 3.5 about monads, category theory, and OOP

Joe:

I have some questions about monads, and functors, can you help answer them?

Chat-GPT:

Sure, I'll do my best to help.
What specifically would you like to know about monads and functors?
class UrlPayloadHandler
{
constructor() {}
base64Enc( inputUtf8Str ) { return Buffer.from(inputUtf8Str, "utf-8").toString("base64"); }
base64Dec( inputB64Str ) { return Buffer.from(inputB64Str, "base64").toString("utf-8"); }
encodeUrlPayload( payloadString ) { return encodeURIComponent(this.base64Enc(payloadString)); }
decodeUrlPayload( encodedPayloadString ) { return this.base64Dec(decodeURIComponent(encodedPayloadString)); }
/* added atob & btoa for cross platform compatibilty (node & browser) as well as documenting their purposes */
btoa = this.base64Enc;
atob = this.base64Dec;
@Node0
Node0 / menuAddRemove.html
Last active July 8, 2022 20:18
A simple menu add and remove html file with js and css.
<!DOCTYPE html>
<html>
<!-- START OF HEAD SECTION -->
<head>
<meta charset="utf-8" />
<title>Menu App</title>
<!-- START OF STYLE SECTION -->
<style>
* {
@Node0
Node0 / ClassesMixins.js
Last active April 18, 2022 08:54
ES6 classes with slick Mixin support!
#!/usr/bin/env node
const cLog = console.log,
Mixin = Object.assign;
function makeMixable(ctx, className) {
/* Automatically enumerates functions of a class and adds them as properties under this of that class's constructor.
* Which makes these methods accessible via the Mixin pattern.
*/
Object.getOwnPropertyNames(className.prototype).forEach( (method) => { if (method !== 'constructor') { ctx[method] = ctx[method]; } })
};
@Node0
Node0 / com_osmembership__helper__subscription.php
Created February 25, 2022 07:59
A gist showing the full updated helper for subscription.php
<?php
/**
* @package Joomla
* @subpackage Membership Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 2021 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
@Node0
Node0 / systemd-wrapper.sh
Last active May 3, 2019 03:49 — forked from mortn/systemd-wrapper.sh
Wrapper script to aid and shorten systemd commands
# vim: tabstop=4 shiftwidth=4 fenc=utf-8 spell spelllang=en cc=120
#
# FILE: systemctl-shell-accelerator.bash
# DESCRIPTION: Convenience method wrappers for Systemd
# LICENSE: Apache 2.0
# CREDITS: http://github.com/yaffare/systemd-shell-wrapper http://github.com/mortn/systemd-shell-wrapper
# MODIFIED BY: https://gist.github.com/Node0/ef2f12469e27501f6cd67cb5db2ead0d
# INSTALLATION: wget -SO/etc/profile.d/systemd-wrapper.sh https://gist.githubusercontent.com/Node0/ef2f12469e27501f6cd67cb5db2ead0d/raw/3109a02eea54c90038df623c0adac2eec2b59228/systemd-wrapper.sh
#
@Node0
Node0 / update_crate-datasource.sh
Created May 20, 2016 20:35
How to update (early versions) of the crate-datasource for Graphana (run this script as root to update the crate-datasource to the latest version).
#!/bin/bash
grafana-cli plugins uninstall crate-datasource;
grafana-cli plugins remove crate-datasource;
rm -rf /usr/share/grafana/public/app/plugins/datasource/crate-datasource /usr/share/grafana/data/plugins/crate-datasource /var/lib/grafana/plugins/crate-datasource/;
grafana-cli plugins install crate-datasource;
mkdir /var/lib/grafana/tempclone;
cd /var/lib/grafana/tempclone;
git clone https://github.com/raintank/crate-datasource.git;
cp -r /var/lib/grafana/tempclone/crate-datasource/dist /var/lib/grafana/plugins/crate-datasource/;
cd ..;
function userList () {
# Help string
helpText="Usage: basename [-h]|[--help] [--username] [--homedir] [--uid] [--gid] [--ugid]
----------------------------------------------------------------;
Help: -h or --help, shows this help page.
username: --username, fetches a list of usernames which are associated with a current user account.
homedir: --homedir, fetches a space delimited list of usernames to home directores.
uid: --uid, fetches a space delimited list of usernames to user ids.
gid: --gid, fetches a space delimited list of usernames to group ids.
ugid: --ugid, fetches a space delimited list of usernames to user ids and group ids.
@Node0
Node0 / arrayLoops.py
Last active February 5, 2016 05:27
business@node-0.com
#!/usr/bin/env python
import os;
import sys;
def printf(fmt, *varargs):
sys.stdout.write(fmt % varargs)
domainListFile = "/root/acctWorkFiles/domainList.txt";
userListFile = "/root/acctWorkFiles/userList.txt";
passwordListFile = "/root/acctWorkFiles/passwordList.txt";