Skip to content

Instantly share code, notes, and snippets.

@alochym01
alochym01 / paginator.go
Created August 26, 2021 15:23
Create a simple Pagination - golang programming
package main
import (
"database/sql"
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
"os"
@leabs
leabs / navbar.astro
Created March 8, 2023 16:56
Astro - Set active class on Navbar component.
<!--Set active class on nav when the page is active -->
<script>
const nav = document.querySelector(".navbar");
const navLinks = nav.querySelectorAll("a");
const currentURL = window.location.href;
navLinks.forEach((link) => {
if (link.href === currentURL) {
link.classList.add("active");
}
});
@jordienr
jordienr / Gradient.js
Created September 12, 2021 00:23
Stripe Mesh Gradient WebGL
/*
* Stripe WebGl Gradient Animation
* All Credits to Stripe.com
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
* commented out for now.
* https://kevinhufnagl.com
*/
@lundeen-bryan
lundeen-bryan / ClsidWin10.md
Last active April 19, 2024 05:35
All CLSIDs in Win10

All CLSIDs for Windows 10

About This File

This md file stored in gist is a list of all CLSIDs for Windows10 that I could find. It's a growing list.

When you want to run this in Run menu Win+r and typs Shell:::{[the clsid number here]}

Last Updated

@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active April 19, 2024 05:35
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane

Pros

  • Usage is simple, you could directly access the config via process.env.NEXT_PUBLIC_*, for example:
// call-site, agents.js
const restaurantApi = axios.createConfig({
 baseUrl: process.env.NEXT_PUBLIC_RESTAURANT_API_URI,
@nosoop
nosoop / makesig.idc
Created February 5, 2019 23:00
makesig.idc with fixes for IDA 7.0
#include <idc.idc>
/* makesig.idc: IDA script to automatically create and wildcard a function signature.
* Copyright 2014, Asher Baker
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
@Kautenja
Kautenja / tar-progress.md
Last active April 19, 2024 05:31
one-liners for using tar with gzip and pv for a progress bar

Compress

tar cf - <files> -P | pv -s $(du -sb <files> | awk '{print $1}') | gzip > <some .tar.gz file>

where:

  • `` is the root-mounted (i.e. starts with /) path to the files
@santaklouse
santaklouse / CrossOver.sh
Last active April 19, 2024 05:28
unlimited CrossOver trial (MacOS)
#!/usr/bin/env bash
# checck if pidof exists
PIDOF="$(which pidof)"
# and if not - install it
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof
# find app in default paths
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS