Skip to content

Instantly share code, notes, and snippets.

View SamJakob's full-sized avatar
:octocat:
Programming

SamJakob SamJakob

:octocat:
Programming
View GitHub Profile
@SamJakob
SamJakob / elf.h
Last active August 23, 2021 21:17
elf.h for macOS 11
/*
Original file: https://gist.github.com/mlafeldt/3885346
Modified by SamJakob on August 23rd 2021 to include changes suggested
by @jastka4.
*/
#undef END_C_DECLS
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
@SamJakob
SamJakob / README.md
Last active August 10, 2021 07:40
GDT Descriptor Macro
@SamJakob
SamJakob / README.md
Last active June 7, 2023 16:40
Terrence (a bot to automatically change Discord guild icons)

Terrence 1.0.0

Changes the guild icons of any guilds the bot is a member of at a defined interval.

Usage

The bot has a customizable command prefix, however the default is t.
The default permission to execute commands is the 'Administrator' permission, however this can be changed.

  • t.update: Allows a user to indicate that an update to the Imgur album is available for the bot. Thus, allowing the cached image list from the album to be updated without restarting the bot.
  • t.change: Allows a user to pre-emptively change the Guild icon to another random image from the image list.

Setup

@SamJakob
SamJakob / smoothscroll.js
Created October 22, 2018 17:10
A vue-js supported smooth-scroll module based on a Stack Overflow answer by Manuel Otto.
const SmoothScroll = (target, speed, smooth) => {
if (target === document)
target = (document.documentElement || document.body.parentNode || document.body) // cross browser support for document scrolling
let moving = false;
let pos = target.scrollTop;
target.addEventListener('mousewheel', scrolled, false)
/* target.addEventListener('DOMMouseScroll', scrolled, false) */
function scrolled(e) {