Skip to content

Instantly share code, notes, and snippets.

View DrSpeedy's full-sized avatar

DrSpeedy

  • United States
  • 14:39 (UTC -05:00)
View GitHub Profile
@DrSpeedy
DrSpeedy / demo.html
Last active April 19, 2024 12:55
HTML/JS Slider Formula Example
<html>
<body>
<!-- Demo [fn(x), ...] slider -->
<h3>Example 1 [fn(x), ...]</h3><br/>
<label for="demoSlider1" class="form-label">Miles Driven</label>
<br/>
<input type="range" class="" min="0" max="1000" step="1" id="demoSlider1">
<br/>
Formula1 (x*2): <div id="f1"></div><br/>
Formula2 (x*3): <div id="f2"></div><br/>
@DrSpeedy
DrSpeedy / Example_LEnglish_Plugin.cpp
Last active September 24, 2023 17:42
Datarazer Sample Language Pack Plugin (3 files)
// Thetadyn Datarazer Copyright (c) 2023 Thetadyn LLC, All Rights Reserved.
// Sample Datarazer language pack plugin
#include "api/Plugin.h"
#include "util/Logger.hpp"
#include "util/Registry.hpp"
#include "locale/Locale.h"
#include "my_plugin/LEnglish.h"
using namespace api;
; HDDQC Sample Settings (Found @ /etc/hddqc/settings.ini)
[packing]
tech_name = BRIAN
form_factor = 3.5
interface_type = SATA_HDD
box_uid = BOX_12345678
; General Settings
[general]
; Determines weather drives will be mapped or not
@DrSpeedy
DrSpeedy / main.cpp
Last active January 22, 2023 23:57
FTXUI Render Thread Example
// This code is from the Datarazer project. You may find more info here: https://wiltech.org/datarazer
// This code also to be used as an example for threaded rendering with FXTUI: https://github.com/ArthurSonzogni/FTXUI
int main() {
// ...
Element current_render = text("Loading application...");
// Initialize renderer
std::mutex render_mtx;
std::mutex event_mtx;
@DrSpeedy
DrSpeedy / 9.SpeedyRunning.lua
Last active August 1, 2022 00:15
Better Super Run v2 GTAV - Stand API
-- Discord: DrSpeedy#1852
-- https://github.com/DrSpeedy
require 'lib/natives-1627063482'
local menu_player_sr = menu.my_root()
local srun_enabled = false
local keys = {}
keys['RB'] = 183
local sr_speed_limit = 120
@DrSpeedy
DrSpeedy / superrun.lua
Last active July 30, 2022 13:16
GTAV: Stand Menu Better Super Run
-- DrSpeedy#1852
require 'lib/natives-1627063482'
local srun_enabled = false
local keys = {}
keys['RB'] = 183
menu.toggle(menu.my_root(), 'Super Run', {'srun_enabled'}, '', function(toggle)
srun_enabled = toggle
local is_super_running = false
@DrSpeedy
DrSpeedy / unifi-test.cmd
Created May 17, 2021 12:29
Automated Iperf3 Testing For Unifi APs
@echo off
set ui_ctrlr_count=1
set iperf_server_ip="10.42.0.1"
set iperf_server_port=5201
set iperf_server_threads=1
set iperf_server_window_size=64k
for /L %%A in (1,1,%ui_ctrlr_count%) do (
#!/bin/local/bash
# cfan.sh
# Manaual control over fans in PfSense (FreeBSD) on a Dell PowerEdge R210 ii system
# Original script: https://www.garron.me/en/bits/specify-editor-crontab-file.html
# Install:
# sudo pkg install bash && sudo pkg install ipmitool
# Add ipmi_load="YES" to /boot/loader.conf
# Add this script to /usr/bin/
# Add * * * * * /usr/local/bin/bash /usr/bin/cfan.sh to cron file with sudo crontab -e
# Reboot
if [ "$USER" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="yellow"; fi
local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})"
PROMPT='
[ %{$fg_bold[orange]%}%n%{$reset_color%}@%{$reset_color%}%{$fg_bold[red]%}%m%{$reset_color%} ]:%{${fg_bold[green]}%}%~%{$reset_color%}$(git_prompt_info)
%{${fg[$CARETCOLOR]}%}➜ %{${reset_color}%}'
RPS1='${return_code} %D - %*'

BASH CHEAT SHEET

Text processing

# Read file without empty lines and new line comments with grep
grep -v '^$\|^\s*\#' /path/to/file.txt
# Read file without empty lines, or any comments even on shared lines