Skip to content

Instantly share code, notes, and snippets.

View MarksCode's full-sized avatar

Ron Marks MarksCode

View GitHub Profile
@MarksCode
MarksCode / use-prompt.ts
Last active April 13, 2024 10:04
return `usePrompt` capabilities from react-router
/**
* Prompts a user when they exit the page
*/
import { useCallback, useContext, useEffect } from 'react';
import { UNSAFE_NavigationContext as NavigationContext } from 'react-router-dom';
function useConfirmExit(confirmExit: () => boolean, when = true) {
const { navigator } = useContext(NavigationContext);
@MarksCode
MarksCode / zshenv
Last active July 10, 2022 10:02
My reusable zshenv
# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/bash_profile.pre.bash" ]] && . "$HOME/.fig/shell/bash_profile.pre.bash"
precmd()
{
local NUMCHARS="$COLUMNS"
local CHAR="─"
printf '\e[37m%s\e[0m' "${(pl:$NUMCHARS::$CHAR:)}"
}
// ==UserScript==
// @name TagPro Stop Test
// @version 0.1
// @include http://tagpro-maptest.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://*.newcompte.fr:*
// @author Cap
// ==/UserScript==
tagpro.ready(function() {
@MarksCode
MarksCode / TPBot.js
Last active November 26, 2017 03:48
// ==UserScript==
// @name TagPro State Bot
// @version 0.1
// @include http://tagpro-maptest.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://*.newcompte.fr:*
// @author Cap
// ==/UserScript==
tagpro.ready(function() {
// ==UserScript==
// @name Teammate Win Percents
// @author EphewSeakay (Feat. Capernicus aka u/StraightZlat)
// @version 0.1
// @include http://*.koalabeast.com:*
// @include http://tagpro-*.koalabeast.com*
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==
// ==UserScript==
// @name Teammate Win Percents
// @author EphewSeakay (Feat. Capernicus aka u/StraightZlat)
// @version 0.1
// @include http://*.koalabeast.com:*
// @include http://tagpro-*.koalabeast.com*
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==
// ==UserScript==
// @name Teammate Win Percents
// @author EphewSeakay (Feat. Capernicus aka u/StraightZlat)
// @version 0.1
// @include http://*.koalabeast.com:*
// @include http://tagpro-*.koalabeast.com*
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==
// ==UserScript==
// @name Teammate Win Percents
// @author EphewSeakay (Feat. Capernicus aka u/StraightZlat)
// @version 0.1
// @include http://*.koalabeast.com:*
// @include http://tagpro-*.koalabeast.com*
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==
if (playerTeam == myTeam) { // check if player is on our team
playersOnOurTeam.push(playerData); // add player's data to our team array
} else { // player is on the other team
playersAgainst.push(playerData); // add player's data to our against array
}
// ==UserScript==
// @name Teammate Win Percents
// @author Ephew
// @version 0.1
// @include http://*.koalabeast.com:*
// @include http://tagpro-*.koalabeast.com*
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==