... to my blog style space for easier contribution by third parties and to provide what I believe to be an easier reading experience. Please field all enquiries and issues to the source repository.
This file contains hidden or 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
| // run a breadth-first search, logging all matches to the console along with the path followed to get there. | |
| // this is designed for interactive use in e.g. browser dev console, | |
| // I use it when i'm writing userscripts to look for places where certain data is exposed through the global scope | |
| // by amgg. | |
| // license: you can do whatever you want forever | |
| function BFS(root, predicate, { traversers = null, chunk_size = 512, verbose = false } = {}) { | |
| // populate default options | |
| traversers ??= [BFS.traversers.key_via_reflect]; |
This file contains hidden or 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
| // get randomly generated string for react elements | |
| var suffix = Object.keys(document.querySelector('#base-container'))[0].split('$')[1] | |
| var reakt = (x)=>`__react${x+'$'+suffix}` | |
| // get current clicked-on post (clicked on OP's url on the dashboard, or went to direct www.tumblr.com link) | |
| var tlo = document.querySelector('[data-testid="timelinePosts"] [data-id]')[reakt`Fiber`].child.child.child.memoizedProps.timelineObject | |
| var poll = tlo.content.filter(x=>x.type=='poll')[0] // get first poll in post | |
| // grab the results for the poll | |
| tumblr.apiFetch(`/v2/polls/${tlo.blogName}/${tlo.idString}/${poll.clientId}/results`).then(function (results) { | |
| let output = [] |
This file contains hidden or 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 Poll Unlocker | |
| // @version 0.1 | |
| // @description gives u polls | |
| // @author Twilight Sparkle | |
| // @license MIT | |
| // @match https://www.tumblr.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=tumblr.com | |
| // @grant none | |
| // @run-at document-start |
Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.
To be able to send a colored text, you need to use the ansi language for your code block and provide a prefix of this format before writing your text:
\u001b[{format};{color}m
I respectfully ask that you don't quote me as “$company person Geoffrey Huntley said” – if I speak for a company, I will publish on its channels. My full name is "Geoffrey Huntley" please use that and not "Geoff Huntley".
- website: https://ghuntley.com/
- newsletter: https://ghuntley.com/newsletter
- twitter: https://www.twitter.com/geoffreyhuntley.com
- linkedin: https://www.linkedin.com/in/geoffreyhuntley
This file contains hidden or 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
| function createElementHelper(tagName, {style:{vars:styleVars={}, ...style}={}, attrs={}, events={}, classList=[], children=[], parent=null, insertBefore=null, ...props}={}) { | |
| let elem = document.createElement(tagName); | |
| for(let k in style) elem.style[k] = style[k]; | |
| for(let k in styleVars) elem.style.setProperty(k, styleVars[k]); | |
| for(let k in attrs) elem.setAttribute(k, attrs[k]); | |
| for(let k in events) elem.addEventListener(k, events[k]); | |
| if(classList.length > 0) elem.classList.add.apply(elem.classList, classList); | |
| for(let k in props) elem[k] = props[k]; | |
| for(let c of children) elem.appendChild(c); | |
| if(parent !== null) { |
This file contains hidden or 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
| if(!(Get-Command git -ErrorAction SilentlyContinue)) { | |
| $gitDir = "$env:LOCALAPPDATA\CustomGit" | |
| if(Test-Path $gitDir) { Remove-Item -Path $gitDir -Recurse -Force } | |
| New-Item -Path $gitDir -ItemType Directory | |
| $gitLatestReleaseApi = (Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/git-for-windows/git/releases/latest).Content | ConvertFrom-Json | |
| $mingitObject = $gitLatestReleaseApi.assets ` | |
| | Where-Object {$_.name -match "MinGit-[\d.]*?-64-bit.zip"} ` | |
| | Select-Object browser_download_url |
NewerOlder


