This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
NSIS Package Code originally developed by Dane Robert Jones <danerjones@gmail.com> | |
NSIS is an Open Source Software Packaging Suite available at: http://nsis.sourceforge.net/Main_Page | |
*/ | |
!define VERSION_MA 0 # <-- The Major version number (DEFAULT: 0) | |
!define VERSION_MI 18 # <-- The Minor version mumber (DEFAULT: 0) | |
!define UPX "${NSISDIR}\Tools\upx.exe" # <-- Path to UPX (If not defined UPX will not be used) | |
!define ICON_PATH "inst.ico" # <-- Path to icon used (If not defined the default NSIS icon will be used) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re, os, sys | |
# This simple script will scan all log files in a folder to verify the name matches the player name used in the game. | |
# If not, the script will list the logs that don't match the name and prompt to correct using the log specified name. | |
path_to_check = os.getcwd() # <-- Default is current direcctory, this should be changed if the script is not run in the same folder as the log files. | |
log_file_extention = ".log" | |
regular_expression_to_get_actual_in_game_name = r"playerName = (\w+)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Enum StemType | |
StemHigh = 1 | |
StemLow = -1 | |
StemDefault = 0 | |
End Enum | |
Public Enum StemSort | |
StemSortNone = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Method takes a string representaion of a positive number from -999,999,999,999,999 to 999,999,999,999,999 and converts into a number. | |
* | |
* @example | |
* ``` | |
* const txtValue = "negative nine hundred and ninety nine trillion nine hundred and ninety nine billion nine hundred and ninety nine million nine hundred and ninety nine thousand nine hundred and ninety nine"; | |
* console.log( text2Value(txtValue) ); | |
* > -999999999999999 | |
* ``` | |
* @param text String representation of positive number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credits go to @Anjuna5 for original code: https://stackoverflow.com/a/39838257/9779148 | |
const mode = arr => [...new Set(arr)] | |
.map(value => [value, arr.filter((v) => v === value).length]) | |
.sort((a,b) => b[1] - a[1]) | |
.filter((v, i, a) => v[1] === a[0][1]) | |
.map(v => v[0]) | |
.sort((a,b) => a - b); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use this one for pasting into a single column | |
copy(Array.from(document.querySelectorAll("div.qws.initialized.focused font[color=red]")).map(e=>e.textContent).join("\n")); | |
// Use this one for pasting into a single row | |
copy(Array.from(document.querySelectorAll("div.qws.initialized.focused font[color=red]")).map(e=>e.textContent).join("\t")); | |
// OTHER: I've used this for wierd outliers but the output data is kinda suspect. | |
copy([...[...document.querySelectorAll('div.qws.initialized.focused *')].filter(el => (el.childElementCount === 0 && el.innerText !== "" && getComputedStyle(el).color === 'rgb(181, 33, 32)'))].map(e=>e.textContent).join("\n")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Get RedText | |
// @namespace https://gist.github.com/0xFireball/0b0673fd7801de9f82278725d1250cbb | |
// @version 0.3 | |
// @description Get's the text text from the WebAssign assignment pages and places them into the clipboard tab delimited. This is good for pasting values directly into excel. | |
// @author Dane Jones | |
// @require https://code.jquery.com/jquery-2.1.4.min.js | |
// @require https://raw.githubusercontent.com/kamranahmedse/jquery-toast-plugin/bd761d335919369ed5a27d1899e306df81de44b8/dist/jquery.toast.min.js | |
// @match https://www.webassign.net/web/* | |
// @icon https://www.google.com/s2/favicons?domain=webassign.net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
import holidays | |
def nextBusinessDay(today=None, additional_offset=0, skip_holidays = True, format=r"%m/%d/%Y", holiday_settings = {'country':'US'}): | |
# pip install holidays | |
h_days = holidays.CountryHoliday(**holiday_settings) | |
# Get todays date if not initially set | |
if today==None: | |
today = datetime.now().date() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple object that requires each keyed value to be a string. | |
*/ | |
interface StringObject {[key: string]: string;} | |
/** | |
* Utility function to create a URL with parameters. | |
* @param url Base URL to build for. | |
* @param uri_values URI parameters to encode add to URL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Callable | |
def purgeValues(value: dict | list, preserve_list_structure: bool = False, purgeTest: Callable[[any], any] = lambda x: x is None or (type(x) is str and len(x) == 0) or (type(x) is list and len(x) == 0)): | |
"""Purge values from a dictionary or list. | |
-------------------- | |
Recursively remove all matching purgeTest values from dictionaries and lists, and returns | |
the result as a new dictionary or list. | |
By default this will remove all `None`, empty string values, and empty lists. | |
If the `preserve_list_structure` argument is set to True, then empty lists will not be |
OlderNewer