Skip to content

Instantly share code, notes, and snippets.

View BillGR17's full-sized avatar

Bill Dallas BillGR17

View GitHub Profile
@BillGR17
BillGR17 / cmd
Last active March 21, 2024 14:15
Get all DNS
#!/usr/bin/env bash
dig any +multiline +noall +answer $1
@BillGR17
BillGR17 / webp
Last active November 9, 2023 20:25
quick webp animate script
#!/bin/bash
f=0
d=100
o="output"
n=""
function throwhelp(){
printf "Usage:\n-f frames\n-n input filename\n-o output filename\n-d duration\n*** All the input files must be .webp format ***\n"
}
@BillGR17
BillGR17 / operations.js
Created January 23, 2023 12:20
Logical operators in Javascript
const log = (x) => {
console.log(x);
};
const list = [
[1, 0],
[0, 1],
[1, 1],
[0, 0]
];
const operations = [{
@BillGR17
BillGR17 / 1.js
Created January 5, 2023 12:33
Hide nav on scroll down and show it on scroll up
// hide navbar on scroll down and show it on scroll up
const navbar_autohide = () => {
let navbar = document.getElementById("top_nav");
let last_scroll = 0;
window.addEventListener("scroll", function() {
let scroll = window.scrollY;
if (last_scroll > 0 && scroll > last_scroll) {
navbar.style.transform = "translateY(-400%)";
} else {
navbar.removeAttribute("style");
@BillGR17
BillGR17 / potato.js
Last active January 5, 2023 10:34
Bootstrap Carousel Video Play/Pause on Next slide And on video end show next slide
// Plays the video and on the end of the video changes slide
// if there isnt a video shows next slide instead
let timeout = null;
function start_end(target, slider) {
if (target) {
target.play();
target.addEventListener("ended", () => {
slider.next();
});
} else {
@BillGR17
BillGR17 / wine_run
Created February 10, 2022 18:40
A script to run exe files on wine and setup dxvk on them
#!/usr/bin/env python
import os
import sys
# Sets prefix location
ROOT_PREFIX_LOC = "/.wine"
# In order to pass our own options
# without affecting anything
# right now or in future
# we separate the path
# of the actual prefix
@BillGR17
BillGR17 / proton
Last active May 4, 2021 20:47
Python script to games and apps using proton
#!/usr/bin/env python
import os
import sys
import shutil
PROTON_PREFIX = ""
PROTON_PATH = ""
def ifError(target, msg, code):
@BillGR17
BillGR17 / proton
Last active January 24, 2021 11:25
Proton script
#!/bin/bash
find_proton(){
# Search for proton file in mnt and Users Home
# Searching for proton folder will have more issues
# since custom proton folders have different names and slashes
# This is the best solution that came to my mind...
# also ignore all the unreadable folders errors
proton=$(find /mnt $HOME -type f -name proton 2>/dev/null)
# Force IFS on line break
IFS=$'\n'
@BillGR17
BillGR17 / screenshot
Created December 20, 2020 15:14
A bash script to take screenshots of current, root or the selected area if there are no arguments
#!/bin/bash
# This script requires xdotool, imagemagick
# This should get the active windows name
ACTIVE_NAME=$(xdotool getactivewindow getwindowname)
# Timestamp is used as the screenshot's name
# Way better than numbering in my opinion
TIMESTAMP=$(date +"%s")
# In case of empty active_name
# Just to play it safe use UNTITLED
if [[ -z "$ACTIVE_NAME" ]];then
@BillGR17
BillGR17 / record
Last active November 15, 2020 18:09
Record Active Window
#!/bin/bash
################################################################
# Requires xorg-xwininfo xdotool ffmpeg gawk
################################################################
# Where to store the video
loc="$HOME/Videos"
if [ -d "$1" ]; then
loc="$1"
fi
# All the xwininfo output from active window