Skip to content

Instantly share code, notes, and snippets.

Avatar
💽

Jessica Stokes ticky

💽
View GitHub Profile
@ticky
ticky / xpathQuerySelector.js
Created Apr 8, 2021
XPath query to array result shorthand function
View xpathQuerySelector.js
// Looks up an XPath node selector and returns an array of matching nodes
const xpathQuerySelector = (xpath) => {
var result = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE);
return Array.from({ length: result.snapshotLength }, (_, index) => result.snapshotItem(index));
};
View gist:726716a6f5a7443baa9f41e3fe4bdebb
BEGIN MESSAGE.
10IhhofVac1GWbT OcaNyQphpJIbi2E oqzy6sP913JPWNy vMA7zsAjbRc7dtz
PjJ0Id0c5kX75Zi XbHhy73ALLZTCKq 6Xr2MZHgg6S42B8 m2VHnHyXfx2YnZm
3G3lJZ74cCbzUlf Cv0jVBEEr2icpW3 a26RxwFdRirpl2m evn0be4PBY27yYe
vREqdURg5dLKkR4 kYz3oidPf5nbrwX bFWY9.
END MESSAGE.
@ticky
ticky / Dream Passport.md
Last active Jul 7, 2019
General Wayback Machine links for Japanese Dream Passport/Dreamcast sites
View Dream Passport.md

ISAO.net

Wow, this had a LOT of changes over the first couple of years!

Notably, from December 2000 until April 2003, there was one unified home page. Before and after those dates, there's an "indexpc.html" specific to the PC, and the Dreamcast is expected to load either "index.html" or "indexdc.html".

View Patreon Mail Forwarder.sieve
### Patreon email sorting-and-forwarding to Feedbin
if
allof(
address :matches "From" "*patreon.com",
header :regex "Subject" "^(?:[^ ]{0,4}(?: Vote in)?) (.*)(?:(?:'s | posted| just shared:?)(?: [0-9]+ )?(?:new(?: patron-only)? (?:images|poll|video|release):)?) \"(.*)\".*$"
)
{
deleteheader "From";
addheader "From" "${1} <\"${1}\"@patreon.com>";
deleteheader "Subject";
@ticky
ticky / mastodon-desktop.user.css
Last active Jan 1, 2021
User CSS to make Mastodon behave somewhat more like a native, desktop app. https://cybre.space/@ticky/100530005338444142
View mastodon-desktop.user.css
.ui {
flex-direction: row;
}
.tabs-bar {
margin: 0;
margin-bottom: 0;
flex-direction: column;
height: auto;
}
@ticky
ticky / curcond.drac.at.injected-after-main-script.js
Last active Apr 6, 2018
JavaScript injected at curcond.drac.at
View curcond.drac.at.injected-after-main-script.js
/* metric 4 lyf mother heckers */
!function (original_parser) {
jQuery.ajaxSettings.converters['text json'] = function (json) {
return original_parser(
json.replace(
/([0-9]+)((?:\\u0026|&|)deg;|\s)([CF]|mph)/g,
function (match, value, separator, unit) {
value = parseInt(value);
switch (unit) {
case 'F':
@ticky
ticky / trace_requires.rb
Created Sep 28, 2017
Trace all require calls. A late-resort debug option in Ruby 2.x.
View trace_requires.rb
require 'pathname'
alias :require_original :require
def require(*args)
called_by = caller_locations(1, 1).first
home_relative_path = called_by.path.gsub Dir.home, '~'
cwd = Pathname.new(Dir.pwd)
cwd_relative_path = Pathname.new(called_by.path).relative_path_from(cwd).to_s
shortest_path = if home_relative_path.length > cwd_relative_path.length
View LICENSE.md

The MIT License (MIT)

Copyright © 2017 Jessica Stokes

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WIT

@ticky
ticky / Clean up Twitter.1blockpkg
Created May 17, 2017
1Blocker (https://1blocker.com) package for making Twitter dot com less actively hostile
View Clean up Twitter.1blockpkg
[
{
"id": "49237CD3-01C4-4F5A-98E6-E771332BE99B",
"name": "Clean up Twitter",
"rules": [
{
"content": {
"action": {
"selector": ".promoted-tweet",
"type": "css-display-none"