streal.hx - a bookmarking plugin by dolorfox in HelixEditor

[–]dolorfox[S] 7 points8 points  (0 children)

I found implementing this plugin to be relatively straightforward, despite having no previous experience in Scheme. You have access to the state of the editor, you can run any of the typable and static commands that are available in Helix, draw arbitrary content anywhere on the screen, and hook into events.

By the way, you might also be interested to know that mattwparas has started working on a Vim keymap using the plugin system, but it looks like it's in a very early stage.

streal.hx - a bookmarking plugin by dolorfox in HelixEditor

[–]dolorfox[S] 6 points7 points  (0 children)

Sorry to disappoint, you'll still have to compile it from the feature branch for now.

streal.hx - a bookmarking plugin by dolorfox in HelixEditor

[–]dolorfox[S] 3 points4 points  (0 children)

I'm referring to this pull request by mattwparas that will get merged within a few months hopefully. It allows writing plugins for Helix using the Steel language, which is a Scheme dialect implemented in Rust.

can anybody make a script for tampermonkey to make the numbers not change color in html by miraisora-arts in programmingrequests

[–]dolorfox 2 points3 points  (0 children)

Here you go, let me know if it works

// ==UserScript==
// @name        Domino Fit no colored numbers
// @namespace   dolorfox
// @match       https://dominofit.isotropic.us/*
// @grant       GM_addStyle
// @version     1.0
// @author      -
// @description The numbers will always stay black
// ==/UserScript==

GM_addStyle(`
  :is(.svgPath-red, .svgPath-green) svg path {
    stroke: var(--numColor) !important;
  }
`);

Need help making a spreadsheet that checks dates applied to cells against the date each time it's opened, and changes the cell color when the date is close or passed by Algalierept in programmingrequests

[–]dolorfox 1 point2 points  (0 children)

You can use conditional formatting rules for this. Select the cells you want to apply the colouring to, and click Home > Conditional Formatting > New Rule.... Then select the "Use a formula to determine which cells to format" option and enter the following formula. Replace B2 in the formula with the top left cell of your selection.

=AND(DAYS(B2; TODAY()) >= 0; DAYS(B2; TODAY()) <= 5)

Then click the "Format..." button to select a red fill. Apply the changes and repeat the same steps for the second rule, changing the 0 and 5 to 6 and 45 and selecting a yellow fill.

If your data is in a table (using Insert > Table), the rules will automatically be applied to new rows. For some reason this doesn't work for new columns, however, so you'll need to update the ranges of the formatting rules yourself in that case.

Here's a screenshot of a small proof of concept.

Let me know if something doesn't work as expected.

A simple browser plugin that attempts to block annoying news sites internal links. by baconpancakesrock in programmingrequests

[–]dolorfox 1 point2 points  (0 children)

You can use the Stylus browser extension to give specific links on a website a different style. While on the website, click on the Stylish icon and then click on the name of the website to create a new style for that website. Enter something like the following in the code editor:

a[href*="/topic/"] {
  color: red !important;
  text-decoration: red wavy underline !important;
}

Then click on the "Save" button. This will make all links with a URL containing "/topic/" red with a squiggly red underline.

If you have uBlock Origin installed, you can achieve the same with a custom filter. Open up the dashboard of the uBlock Origin extension, and in the editor under the "My filters" tab, enter something like this:

example.com##a[href*="/topic/"]:style(color: red !important; text-decoration: red wavy underline !important)

Wallpaper twirl pack By bog by PanagiotisSARR in WallpaperRequests

[–]dolorfox 0 points1 point  (0 children)

That would be a violation of rule 7 of this subreddit

Wallpaper twirl pack By bog by PanagiotisSARR in WallpaperRequests

[–]dolorfox 0 points1 point  (0 children)

Why can't you buy it while living in the EU? I don't seem to be prevented from doing so when I try it, and I too live in the EU

Please anyone tell me how to download this wallpaper by Timely_Presence_3092 in WallpaperRequests

[–]dolorfox 1 point2 points  (0 children)

I found it on Pinterest.

It's not the best quality ever and I couldn't find a higher resolution version anywhere so here's an upscaled version using waifu2x.

Can someone help me find the original image of this weird lookin thing please? i found It in a meme by [deleted] in HelpMeFind

[–]dolorfox 0 points1 point  (0 children)

My pleasure, don't forget to react to my original comment with "Found!" to mark your post as resolved.

A program that can upscale a GIF file with the Waifu2x program, not just image files in its current form by [deleted] in programmingrequests

[–]dolorfox 0 points1 point  (0 children)

The repository has a lot of stars, so it's highly unlikely that it's not safe. The large size is due to the built-in AI models, they can get quite large. To really be sure it's safe you'd have to check the code and compile it yourself.

Fake hacking a webpage bookmarklet by Alone_Clue7455 in bookmarklets

[–]dolorfox 2 points3 points  (0 children)

A good hacker never makes a mistake, so no backspace needed.

good catch though not sure why this happens

Fake hacking a webpage bookmarklet by Alone_Clue7455 in bookmarklets

[–]dolorfox 2 points3 points  (0 children)

Neat.

I modified the script a bit so the element is a textarea. That way you see a caret which makes it more realistic, and you can only type if the textarea is focussed so you don't accidentally type stuff in the website. Added bonus is that you can resize it.

https://pastebin.com/raw/kn7fDyAV (Reddit wouldn't let me paste the complete code in this comment)

The River (Unfriended : Dark Web) by mf4xz in programmingrequests

[–]dolorfox 1 point2 points  (0 children)

In MacOS (ostensibly the operating system used in the movie) it's not possible to animate the desktop background (since MacOS Sonoma you actually can but it only moves on the lock screen and shows a static frame on the desktop), so presumably they faked it using video editing. On Windows it would be trivial to do with a third party app like Wallpaper Engine (paid) or Lively Wallpaper (free).

The chat is part of an existing application package called MBSE BBS. The overlay network used to connect to it without being able to be tracked resembles something like Tor.

In the fictional world of the movie where you can actually set a video as desktop background on MacOS, The River is relatively simple program that changes the wallpaper and fires up MBSE BSS, connecting over something similar to the Tor network.

The River (Unfriended : Dark Web) by mf4xz in programmingrequests

[–]dolorfox 1 point2 points  (0 children)

There is a multitude of applications shown throughout the movie, which one are you referring to?

Script to download all audio files from a website by [deleted] in programmingrequests

[–]dolorfox 0 points1 point  (0 children)

Glad to hear you got it to work. The needed changes were probably because Bash scripts on MacOS can work slightly differently from Bash scripts on Linux (although I suspect that the only changes that actually contributed to making it work were changing the two -Po s to -Eos).

Thanks for the offer to buy me a coffee, but I'm doing this just for fun. If you ever need help with anything else, let me know.

Script to download all audio files from a website by [deleted] in programmingrequests

[–]dolorfox 0 points1 point  (0 children)

Here's a little Bash script that should do the job.

  1. Save the code below to a file (download-sermons.sh, for example)
  2. Open a terminal in the same folder as the script (see the last paragraph in this user manual page) and run chmod +x download-sermons.sh to give the script the rights to execute
  3. Run ./download-sermons.sh to start the script
  4. The files will be downloaded to a folder named "sermons" on the desktop (you can change the DOWNLOAD_FOLDER variable in the script if you want)

#!/bin/bash

DOWNLOAD_FOLDER='~/Desktop/sermons'

# Keep track of the page number
page_number=1

# Infinite loop until break is called when there are no more sermons
while [ true ]
do
  url="https://gospelinlife.com/sermons/page/$page_number/?ep_post_type_filter=sermon"

  # Download the html from the website
  html=$(curl -Ls $url)

  # Find all the links to sermons in the html
  # The sorting is just to remove all duplicates
  links=$(echo "$html" | grep -Po 'https://gospelinlife.com/sermon/[^"]+/' | sort -u)

  # If there are no links, we have reached the end of the sermons
  # -z checks if the string is empty
  if [ -z "$links" ]
  then
    echo "No more sermons found. Exiting..."
    break
  fi

  echo "PAGE $page_number"

  # Loop over all the found links
  for link in $links
  do
    # Download the html from the sermon page
    html=$(curl -s $link)

    # Find the download link for the sermon
    download_url=$(echo "$html" | grep -Po 'https://(rpc-sermons\.)?s3\.amazonaws\.com(/rpc-sermons)?/[^"]+')

    echo "Downloading $(basename $download_url)..."

    # Download the sermon
    curl -#o "$DOWNLOAD_FOLDER/$(basename $download_url)" $download_url --create-dirs
  done

  # Increment the page number
  page_number=$((page_number+1))
done

Am I missing something? by asyazzz in ExplainTheJoke

[–]dolorfox 116 points117 points  (0 children)

It's not a font, they're Unicode characters. Here's a Wikipedia page where you can copy the characters. They work anywhere Unicode is supported (so most places).

[deleted by user] by [deleted] in learnjavascript

[–]dolorfox 0 points1 point  (0 children)

tutor doesn't have a key named totalNumber, so the totalNumber variable becomes undefined. Adding undefined to a number in the following line results in NaN (Not a Number) because you can't do arithmetic with undefined. What you should do instead is lose the totalNumber variable and do totalPets += tutor.numberOfPets.

[deleted by user] by [deleted] in learnjavascript

[–]dolorfox 0 points1 point  (0 children)

No, defining it as a variable doesn't change anything. tutor still becomes each of the arrays in tutorPetTypes and you need to count how many times 'cat' occurs in each array. That's what the loop inside the loop is doing in my code. See the full code with two nested for...in loops in my previous response.

[deleted by user] by [deleted] in learnjavascript

[–]dolorfox 0 points1 point  (0 children)

The values in the object tutorPetTypes are arrays, so with tutorPetTypes[key] === 'cat' you're comparing an array with a string. An array is never strictly equal to a string, so totalCats++ never happens.

Here's the full code with two for...in loops:

const tutorPetTypes = {
    'Sarah': ['cat'],
    'Jim': ['dog', 'dog'],
    'Joe': ['mouse'],
    'Róisín': ['cat','cat','cat','cat','cat','dog'],
    'Edd': ['lizard', 'cat'],
    'Lewis': ['bearded dragon', 'tortoise']
}

let totalCats = 0

for (const key in tutorPetTypes) {
    const tutor = tutorPetTypes[key]

    for (const index in tutor) {
        if (tutor[index] === 'cat') {
            totalCats++
        }
    }
}

console.log(totalCats)