telepresence

joined 1 year ago
[–] [email protected] 0 points 2 days ago (1 children)

probably off topic, but i never understand people who actually use a trackpad, as i find them horrible to use and carry around a bt mouse w my notebook so i don't have to use the trackpad. if you have the time, could you please explain a bit why you personally use it? Thanks!

[–] [email protected] 2 points 2 days ago

i personally wouldn't use it as it's more inconvenient. also i suggest probably go outside /hj

[–] [email protected] 1 points 2 days ago

why would you wanna kill the programming language commitees.

[–] [email protected] 2 points 5 days ago
[–] [email protected] 2 points 1 month ago

EDEN - vertigo (album)

[–] [email protected] 2 points 1 month ago

There's a great yt channel which has inkscape tutorials called Logos by Nick

[–] [email protected] 3 points 1 month ago

This came pre-installed on fedora kde spin, and i really tried to like it.But it couldn't, it just didn't work intuitively, kept freezing, options were missing,... Right now i'm using audacious, and I like it a lot. Still a big fan of KDE's stuff, for example, i love the Haruna media player <3

[–] [email protected] 3 points 1 month ago

i'm fine with any donation notifications, even on by default, if they can be disabled.

[–] [email protected] 15 points 1 month ago

this is hard as fuck holy

[–] [email protected] 1 points 2 months ago

i have a pocketbook touch lux 4 and a boox page. both are good at their own thing: the book trades a bit of battery life and a higher price for being able to run any android app like tachiyomi, etc.
my recommendation is look through what e-readers are supported by koreader, the best e-reading app, and also, get something with physical page turn buttons and enough/expandable storage.

[–] [email protected] 5 points 2 months ago (1 children)

lemon. always lemon. if i get more than 1 scoop, then salted caramel or something with chocolate (like bounty, snickers, oreo, crunchy, dark chocolate, etc)

[–] [email protected] 3 points 2 months ago

no, not really. i kinda quit social media in the sense that i no longer use reddit, instagram, twitter or snap. they were all just too addicting. i log into lemmy once in a while, to see what's new, since there are some nice niche linux related communities, but apart from that i'm only on youtube (when i'm eating) or on discord (few small-ish servers). i don't really care much for news or polictics, and if i really need to know what's going on, i check the front page of wikipedia or ask my friends. i'm still struggling with using my phone more that i'd like, but this week i took a break from discord and youtube, with mixed results so far (see: i'm on lemmy), but overall it's been really freeing to not be on them and have a bunch more free time.

 

i saw recently that there is a first algorithmically optimized layout added, RSINOA. i'm wondering:

  • is it actually good?
  • is anyone using it?
  • how much better is it than normal thumb-key english (if it is)?
  • is it worth learning it if i already know the thumb-key layout without looking at the keyboard?
  • is it in it's final state? or are big changes to the letter placement expected and i should wait before learning it?

thanks!

 

i made a type-safe GroupBy function.

/**
 * Groups array of objects by a given key
 * @param arr array of objects to group
 * @param key must be present on every object, and it's values must be string|number
 * @author telepresence
 * @license CC-BY-4.0
 */
function groupBy(arr: T[], key: keyof T, defaultAcc: Record = {}) {
    return arr.reduce((acc, val, i) => {
        const compValue = val[key];
        if (typeof compValue !== 'string' &amp;&amp; typeof compValue !== 'number') {
            throw new Error(`key ${key.toString()} has values other than string/number. can only group by string/number values`);
        }
        if (!acc[compValue]) acc[compValue] = []
        acc[compValue].push(val);
        return acc;
    }, defaultAcc);
}
  • like lodash's groupBy, but by key and not function
    • group an array of objects which all have a key in common into an object with keys matching all the different possible values of your common key
  • type-safe, no unknown's no any's
  • does not copy arrays ([...array]), uses push
  • supports selecting by keys, where the key values are string / number (although you can easily add symbol support)
  • shared for free under the CC BY 4.0 license - only attribution is requred (link to this post is fine)
  • custom default accumulator support, if you already know the groups beforehand and would rather have an empty array than undefined.

example:

const data = [{
  "name": "jim",
  "color": "blue",
  "age": "22"
}, {
  "name": "Sam",
  "color": "blue",
  "age": "33"
}, {
  "name": "eddie",
  "color": "green",
  "age": "77"
}];

groupBy(data, 'color') 

would result into:

{
  "blue": [
    {
      "name": "jim",
      "color": "blue",
      "age": "22"
    },
    {
      "name": "Sam",
      "color": "blue",
      "age": "33"
    }
  ],
  "green": [
    {
      "name": "eddie",
      "color": "green",
      "age": "77"
    }
  ]
} 

TL;DR i've sucessfully wrote something using generics in typescript for the first time, and i think it's pretty epic.

2
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Banger i found randomly when checking the twitter of one of my favorite artists, @xyanaid. They made the album cover.

edit: Spotify link

view more: next ›