Skip to content

Instantly share code, notes, and snippets.

View Araxeus's full-sized avatar

Araxeus

  • Discord: `Araxeus#0819`
  • 08:41 (UTC +03:00)
View GitHub Profile
@Araxeus
Araxeus / GitHub Markdown Tooltips.md
Created February 17, 2023 20:14
GitHub Markdown Tooltips

Hover itㅤ


Hover itㅤ[<img src="https://www.wppluginsforyou.com/wp-content/uploads/2020/05/tooltips.png" width="15px" />
](## "Code preview syntax was generated using gh-linguist-preview")
const isDev = !app.isPackaged;

image

const isInstalled = app.isPackaged && !process.env.PORTABLE_EXECUTABLE_DIR;

Keybase proof

I hereby claim:

  • I am araxeus on github.
  • I am araxeus (https://keybase.io/araxeus) on keybase.
  • I have a public key ASC01sIXGolKO5NLBUm_U9Ue3fOHRhDMD-DGLCmdjhtYzQo

To claim this, I am signing this object:

@Araxeus
Araxeus / bookmarklet.js
Last active April 20, 2022 16:24
Search reddit comments in thread
javascript: (() => {window.reddit_comment_search??={loadingIcon:'<svg xmlns="http://www.w3.org/2000/svg" style="margin:auto" width="35" height="35" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" display="block"><circle cx="50" cy="50" r="32" stroke-width="8" stroke="#ff4500" stroke-dasharray="50.265 50.265" fill="none" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1.5s" keyTimes="0;1" values="0 50 50;360 50 50"/></circle></svg>',ogIconHtml:document.querySelector('[aria-label="Home"] svg').outerHTML,regex:regex=/\d more repl(?:y|ies)/,search:[],currentIndex:0,afterExpand(){const e=document.querySelector("input#header-search-bar")?.value;e?this.searchFor(e):this.searchForLinks(),console.log(`Done searching (${window.reddit_comment_search.search.length} results found)`),window.reddit_comment_search.rcsLoaded||(document.addEventListener("keydown",(({code:e})=>{"Period"===e&&this.next(),"Comma"===e&&this.previous()}),{passive:!0}),this.rcsLoade
@Araxeus
Araxeus / day2.js
Last active April 9, 2022 09:22
Advent of Code 2021
const x = $('pre').textContent;
[...x.matchAll(/(?<dir>\w+) (?<num>\d+)/g)].reduce((p, c) => ({
y: c.groups.dir === 'forward' ? p.y + Number(c.groups.num) : p.y,
x: p.x + (c.groups.dir === 'up' ? Number(-c.groups.num) : c.groups.dir === 'down' ? Number(c.groups.num) : 0)
}),{x: 0, y: 0});
// ******************************************************************************************************************** Part 2
const x = $('pre').textContent;
@Araxeus
Araxeus / polyfill.js
Last active September 21, 2023 14:04
Array[`replace`/`replaceAll`/`groupBy`]
const defineArr = (prop, value) => {
if (!Array.prototype.hasOwnProperty(prop)) {
Object.defineProperty(Array.prototype, prop, {
value
});
}
};
defineArr('groupBy', function value(fn) { return this.reduce((p, c, i) => {
const k = fn(c, i, p);
@Araxeus
Araxeus / zip.ps1
Last active January 29, 2024 07:34
Powershell script to zip files while preserving folder structure - includes lots of optional parameters like: file sync, exclude files, zip overwrite, custom FilterScript, automatic zip name from json, and more
#!/usr/bin/env pwsh
#Requires -Version 7
# Specifying no parameter will result in current working directory ($pwd) being archived into $pwd\$pwd.zip
param (
# The following paths can be relative or absolute:
# path to folder/s containing the files to be archived
[Alias("i","input","from")][string[]][ValidateScript({ Test-Path -LiteralPath $_ })] $FolderPaths = @($PWD),
# path to zipfile / zipFolder if $ZipNameFromJson is specified (will be created if it doesn't exist)
[Alias("t","to","output")][string] $ZipPath = "", # defaults to $PWD.zip
@Araxeus
Araxeus / index.html
Last active February 26, 2022 20:54
Electron 12^ notification bug - gist for https://github.com/electron/electron/issues/29557
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<h1>Notifications Example</h1>
</p>
<button>Send Notification</button>
<script>
const virtualKeyCodes = {
ShiftLeft: "Shift",
ShiftRight: "Shift",
ControlLeft: "Ctrl",
ControlRight: "Ctrl",
AltLeft: "Alt",
AltRight: "Alt",
MetaLeft: "Super",
MetaRight: "Super",
NumLock: "NumLock",