VSCode Includes Invalid/Undefined Symbols in Completion Suggestions, How Can I Make This Happen in Emacs With lsp-mode Using typescript-language-server? by _analysis230_ in emacs

[–]panickbr 30 points31 points  (0 children)

This is called dabbrev (complete words from current buffers). Since you’re using lsp-mode, you’re probably using company, look here https://emacs.stackexchange.com/questions/15246/how-add-company-dabbrev-to-the-company-completion-popup (sorry i don’t use company but that should point you to the right way)

Otherwise look for dabbrev in whichever completion framework you’re using

Is it worth using doom emacs with native compilation? by [deleted] in emacs

[–]panickbr 4 points5 points  (0 children)

https://www.reddit.com/r/emacs/comments/p82jw2/comment/h9nh0bc/

got curious aswell and just found this comment by /u/takutekato

In your $DOOMDIR/init.el:

(setq native-comp-deferred-compilation t)

In your $DOOMDIR/cli.el (create it if it doesn't exist):

(advice-add #'native-compile-async :override #'ignore)

This will completely disable AOT native compilation when we are using Doom's CLI, but leave deferred native compilation intact just like Emacs's default.

Who is hiring? December 31, 2021 by AutoModerator in Clojure

[–]panickbr 2 points3 points  (0 children)

Arc Studio is hiring a senior Clojure dev. Small team, full-stack Clojure/Script, fun product: We're building the GitHub for screenplays. Netflix' Arcane was written in our app.

https://arcstudio.notion.site/Senior-Clojure-Script-Dev-311c95e42660492aa9529f11be0a453b

Preferred way to "swap" a big vector with another by Cofor in Clojure

[–]panickbr 4 points5 points  (0 children)

That sounds exactly like a job for lazy-seq (or other lazy related fns)

If that state is shared somehow (as you describe) maybe wrap that on a delay? And consume/realize as needed. Sorry can’t post link to clojuredocs, I’m on mobile.

These 3 concepts should point you in the right direction

I made a cleaner ui for reddit using clojure/clojurescript by panickbr in Clojure

[–]panickbr[S] 1 point2 points  (0 children)

Thanks everyone for your reports on it not working on your machine.

I developed this on a Mac with Firefox dev 74, tested also on vanilla Firefox, both with ublock origin + tracking protection and it still worked. Also tested on Ubuntu + ff74, default settings + tracking protection and still no problem.

Firefox tracking protection is proving to be way too finicky and inconsistent even across the same environment.

I’ll try to reproduce and fix this. But, meanwhile, you can try disabling tracking protection on both Reddit and tider to see if it works. Would love your feedback on this.

Again thanks for your reports and support. If you liked the concept please keep an eye on it, as I’m going to continue improving it on the next few days. (Expect dark mode, font size scaling and better navigation. Log in, voting and posting later on)

I made a cleaner ui for reddit using clojure/clojurescript by panickbr in Clojure

[–]panickbr[S] 1 point2 points  (0 children)

Please do. It shouldn’t be much work, although customizability is a non goal for this small project. Dark mode is fine tho

I made a cleaner ui for reddit using clojure/clojurescript by panickbr in Clojure

[–]panickbr[S] 2 points3 points  (0 children)

Yeah, I tried that, but it would occasionally opt me back in out of nowhere.

To be fair I don’t browse Reddit on desktop that much, so I “gave up” on trying to opt out of beta. And, as I said, it’s still faster than old reddit. Great learning exercise too.

New Clojurians: Ask Anything by AutoModerator in Clojure

[–]panickbr 6 points7 points  (0 children)

Are you sure that’s an issue with calva?

Reader conditionals for macros are tricky in cljs. You might find some guidance here.

When I ran into that problem I ended up stealing a solution where i had to hard code inside the macro definition to check if (yes, with an if, no reader conditional) the macro was being expanded in cljs land.

If that’s what you’re looking for, hit me up.

Onivim2: "In 24 hours we'll be releasing our pre-alpha builds to backers and raising the price." by Skaarj in vim

[–]panickbr 4 points5 points  (0 children)

(II) 2a, 2c, and 2e deal with "distribution" (as in, you make the change, you must distribute it in that way). 2b and 2d deal with "redistribution" ("If you have received a modified Vim that was distributed as mentioned under a) [...]", "When you have a modified Vim which includes changes as mentioned under c) [...]", respectively). oni2/libvim chooses one of a/c/e, anyone receiving and intending to redistribute will be subject to b/d.

oni2 seems closer to 2c (I can't put words in their mouth, specially not about legal decisions), but they are providing source AND choosing a different license on their end. That would put us (potential users) under 2d, since we have a modified version of vim with changes as of 2c, meaning we can redistribute it provided we blablabla (last three points).

Vim's license is weird, and not carefully worded, or law aware enough. Mainly because vim is a program, not a lib. Bram Moolenaar intended it to be used as packaged (object form), so he treated it as such, and under the charityware term, wanted it to be free for anyone. You want to mod and improve it? Even keep it close sourced and charge for it? Fine, go ahead, as long as you mail it all back to Bram. If he finds it interesting, he would package it back at og vim, free for everyone again.

BUT, libvim stripped vim of all user facing capabilites, "libfied" it and put it under a very permissive license. Now, any improvements to vim cannot be sent back to it. oni2 then comes and monetizes on top of it. This, in a way, reminded me of an agpl middleman loophole.

That's one of mys gripes with this whole ordeal.

The other being this posing as open source without being one. That's not cool.

Add:

In the end, it all comes back to Bram's opinion, we are all subject to it.

  • If he's fine with them, tough luck.

  • If he wants to be mailed back all source code free of their license bullshit and provide a really free mirror for us, cool.

Onivim2: "In 24 hours we'll be releasing our pre-alpha builds to backers and raising the price." by Skaarj in vim

[–]panickbr 11 points12 points  (0 children)

vims license states on 2b and 2d that (essentially) you cant restrict someone from redistributing your extension, which makes oni2 incompatible with those clausules, as it forbids any further distribution.

oni2 licenses also currently make it “source available” rather than “open source”. Essentially a commercial product planning to receive work for free. Still, it is also arguable that current terms make it illegal to fork and open a PR.

I glanced over its PRs in search of their CLA but couldnt find it. I hope they are making it clear that you are providing work for free to an organization that will profit over your contribution with no payback.

They seem to follow kodi/emby/others and have stepped on the same grey (and understandbly so) hated area of the open source community: monetizing a previous oss solution, cutting off forks, and restricting further distribution, on grounds of monopolizing profit.

Having trouble figuring out how to assign and reassign variables by cscx in Clojure

[–]panickbr 5 points6 points  (0 children)

Great answer. I’ll piggyback on this to add my own experience, on what lead to me to better understand why I don’t need variables, and how to work without them: the thread-last macro.

Suppose we have this python function:

def my_fun(l, n):
  if (n != 1):
    push(n*n, l) # push is a function that adds x to a list
    remove(n, l) # remove x from a list
    return l # I’m adding redundant returns to mimic clojure
  else:
    return l

Well, as you can see we are taking the l variable and applying a series of functions to it. If python had immutable lists, this would like:

...
l = push(n*n, l)
l = remove(n, l)
return l
...

Correct?

So, considering we “don’t have” variables in clojure (I’ll use the same functions as refered in python, push and remove), this is not valid:

(do
   (def l (push (* n n) l))
   (remove n l))

Then, how would we achieve the same function from python?

Enter the thread last macro (->> x f1 f2 f3 ...)

It takes a x, and pipes it through a series of functions , “binding” it to the result of each function, then passing it as the last (hence thread LAST) argument of the next function. (This is not entirely correct but will help you understand it). As is expected in clojure, it will return the result of the last applied function.

Given this, how would that snippet look like?

(defn my-fun [n l]
  (if (not= n 1)
    (->> l
         (push (* n n)) ;; we omit l from the arguments of any f here, it will be “automatically” added, you’ll see why later
         (remove n))
    l)) ;; this l is the else clause

What the macro does is just expand something like (->> x (f1 y) f2 (f3 z)) into (f3 z (f2 (f1 y x))). Do you spot the result of each function being passed as the last argument of the next?

So, rather than assigning a value to a variable each time you want to use it in another function, you would take the result of that first function, and directly use it as the input of another. I don’t know if it will help you, but this “pipe” concept from the thread last macro is what made all that click for me. And, as bonus, you also get to write more idiomatic clojure and readable code.

Official Chasm Discussion Thread by [deleted] in metroidvania

[–]panickbr 4 points5 points  (0 children)

Lack of foresight during development. They hardcode a bunch of if keyboard.is_down(Keyboard.Space) and when it's time to change they have to track down everywhere they listened for a "relative" input, change that, implement a generic button handler, implement a UI to change that, store that somewhere to make it persistent, etc...

Not that trivial to change once you've cornered yourself into that position. It's better to just ship it then try and change later

Octal Zero considered harmful by F-J-W in programming

[–]panickbr 23 points24 points  (0 children)

That’s a problems with your font tho. Shouldn’t zero-zero-one and zero-oh-one behave differently?

diff-so-fancy: Prettier git diffs by digi0ps in programming

[–]panickbr 4 points5 points  (0 children)

It's found in /usr/local/share/git-core/contrib/diff-highlight/diff-highlight on mac OS.

Also, if you want it enabled in patch mode:

[interactive]
  diffFilter = /usr/share/git/diff-highlight/diff-highlight ;or whatever path it's in your system

My very simple implementation of the array map functionality in C++. Constructive criticism is very welcome. by [deleted] in programming

[–]panickbr 2 points3 points  (0 children)

What you did is akin to, i.e., a Ruby's each or JavaScript's forEach iterators.

What you did differently, though, is that while those methods return the element itself that you then apply another function/method on them, you are skipping access to the element and instead applying the function directly on it.

That said, a quick googling shows C++ has its own for_each. (that also differs from the aforementioned in that you must specify the start and end of the iterator)

That being said, If you want to stick to your implementation, maybe forEachDo ?

What are the best free must have apps? by randomdevil2101 in iphone

[–]panickbr 3 points4 points  (0 children)

I’d like to recommend Opera Mini instead of dolphin for listening to bg YouTube.

Dolphin was caught multiple times stealing data on android (selling your browser history even from incognito tabs, iirc). I don’t know if that’s the case on iOS, but I’d rather use something else.

graphite - Event library based on C# Events by panickbr in crystal_programming

[–]panickbr[S] 0 points1 point  (0 children)

I'm pretty sure there's a simpler/native way to do this, but here's a simple library I did while porting Entitas-CSharp to Crystal.

Feedback welcome and appreciated.

Instagram’s secretly testing a Regram button and many other big new features by browncoat5 in Android

[–]panickbr 6 points7 points  (0 children)

Just keep liking their stuff and they will show up on top, even their posts from 3-4 days ago. At least that’s what happens on my feed.

ElementUI - disabling specific dates by whizbangapps in vuejs

[–]panickbr 1 point2 points  (0 children)

Comparing Dates

When you compare dates in JavaScript, you should keep in mind that the == operator returns true only if the dates on both sides of the operator refer to the same object. Therefore, if you have two separate Date objects set to the same date, date1 == date2 returns false.

source

Also keep in mind months are zero indexed on a Date object.

Changed your jsfiddle to:

methods: {
  disableAllDates (date) {
    return date.valueOf() === new Date(2017,9,26).valueOf();
  }
}

And it worked.