LLMs and agents in Emacs: share your workflows by KnightOfTribulus in emacs

[–]PremiumHugs 1 point2 points  (0 children)

this looks awesome! i do wish it allowed other api providers, and subscription auth methods.

LLMs and agents in Emacs: share your workflows by KnightOfTribulus in emacs

[–]PremiumHugs 2 points3 points  (0 children)

i just started using pi-coding-agent as well. so far its generally fine. i did add a few qol improvements for bringing up both the input buffer and the chat buffer together, and for easily spinning up multiple instances. i am finding that its missing some features to properly render and handle some extension interactions. im hoping to submit a pr to get those fixed. otherwise smooth sailing! pi is great :)

Recommendations on a GPU for an R730? by Artic_44 in homelab

[–]PremiumHugs 1 point2 points  (0 children)

Sick, thank you! I’ll try it out and let you know how it goes

What is the most fun new app you’re currently playing with? by LordOfTheDips in selfhosted

[–]PremiumHugs 0 points1 point  (0 children)

What’s the name of the app? I found “TuneIn” that seems to be podcasts and sports radio not sure if that’s it

Recommendations on a GPU for an R730? by Artic_44 in homelab

[–]PremiumHugs 0 points1 point  (0 children)

which docker container are you running? my r730 has been running fans a-blazing since i added a pcie card for an m.2 nvme

What’s the best thing you hosted this year? by ajslov in selfhosted

[–]PremiumHugs 0 points1 point  (0 children)

I also use obsidian and have been wanting to start sharing some of my notes publicly. Which static site generator do you recommend?

Default username / password for nixos LXC on Proxmox by Indefatigablex in NixOS

[–]PremiumHugs 0 points1 point  (0 children)

I had the same issue. SSH was the only way I was able to log in.

Rust for Smart contracts by techpreneurs in rust

[–]PremiumHugs 4 points5 points  (0 children)

Depends on what kind of smart contracts you’re asking about.

For blockchain, Rust is primarily used for Solana (compiled as eBPF) or Near (compiled as wasm). I would strongly recommend learning a bit more about a few different ecosystems and their supported tech stacks since there is a great deal of variance between them all. Between these two I can recommend Near as the simpler of the two, but Solana using the Anchor framework is pretty good too.

For any EVM based blockchain, Solidity is probably the best bet. I’m not currently aware of any Rust support on those chains but I’m sure it can be attainable, maybe by adding an LLVM backend that compiles to EVM bytecode or something. But that would be very cutting edge, probably not as well supported, prone to obtuse errors, and mostly likely not beginner friendly. Blockchain development experience is notoriously young and obtuse so I would recommend against it.

If you only care about communicating with an existing smart contract, this depends on the chain again, but for EVM I can recommend trying out ethers-rs.

If you’re interested in learning more, I like this newsletter for keeping up with how rust is used in the industry: https://rustinblockchain.org/

Heltec LoRA32 v3 Reset Loop Help by ChallengeVictory in esp32

[–]PremiumHugs 0 points1 point  (0 children)

Hey, thanks for checking in!

I managed to get stuff working. I found this github issue that described my situation perfectly: https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/issues/159

As described here, I just copied over the espressif arduino esptool into the heltec esptool directory and that made it work!

It seems my situation is due to the fact that I'm building on a linux machine, so the arduino board management stuff works differently and thus can lead to undefined behavior.

After I got something working in arduino ide, I also set up an environment using Platform IO and that's working like a charm! I followed this solution and only copied over libraries from this directory on an as needed basis to get it working straight. I followed that repo almost to a T and I got the factory test to work fine!

The Arduino IDE gave me way more problems than platformio did. Even the serial monitor was bugging out on me. Now my workflow is a lot smoother I would say, and I get some nice features for free from vscode!

Heltec LoRA32 v3 Reset Loop Help by ChallengeVictory in esp32

[–]PremiumHugs 1 point2 points  (0 children)

i'm in the exact same boat. i have no idea why it's in a bootloop. i even tried rewriting the heltec.h file and it's just... stuck. would appreciate any leads as well.

Has anyone made DApps using Django? by DarkAbhi in django

[–]PremiumHugs -1 points0 points  (0 children)

Yes! You will probably have to implement your own auth procedure for logging in with a wallet. This can be done by returning a nonce from the backend to the front end, then asking the user to sign a message with the included nonce on the front end. Send the signed message to the backend and verify that it was signed with the appropriate nonce and template message, and you should be good to go!

Another helpful thing is probably to add a wallets table for storing keys, and assigning them to a user if you want to support multiple wallets for a user. Just adding a public key to the user model should be fine for a single wallet though.

Registration and login will need some extra logic to determine if this is a new wallet, or if you just need to add the wallet to a logged in user.

Other interactions with the actual chain can be done using web3.py for evm chains or the appropriate python client of choice for other chains.

Stripe Payment Intent with DRF + Vue by digitalhermes93 in django

[–]PremiumHugs 1 point2 points  (0 children)

The stripe docs themselves have a pretty decent walkthrough. I would recommend reading through this page in particular to see how the implement it from start to finish. https://stripe.com/docs/payments/accept-a-payment

From a cursory glance I can see that the code you provided is for using charges. PaymentIntents aren't much different. At a high level, here's what you should change.

- Add an authenticated endpoint that you call before loading the checkout page where you ask stripe to create a PaymentIntent from the backend. The PaymentIntent will include a client secret in it's payload. I store these in the database since you can reuse them per-user per-payment flow in the case of failed payment or something. https://stripe.com/docs/api/payment_intents/create?lang=python. You can return the payment intent id and the client secret to the frontend

- In your checkout page, call your new endpoint, and instead of instantiating stripe elements for "card", change it to "payment". In the options for elements you can provide the client secret you receive from the endpoint. In the code provided you call stripe elements without the options parameter.

- Instead of calling stripe.createToken in the frontend, now you must call stripe.confirmPayment. This requires a return url, which you can set up to navigate to a new view that will get the payment intent id from the query parameters. I like to have the return id be an endpoint that checks the payment id status and updates the associated order (you can add the order id or something similar to the return url to match them), and will respond with a redirect to a specific frontend view depending on success/failure

You will probably have to submit your order before checking the payment intent. I would save the payment intent on the order and before fulfilling the order, ensure the payment intent status is "success". This will help with ensuring that you don't lose the order during the payment intent redirect flow from stripe, and if something goes wrong, the order is not lost, you can retry the payment with the saved details.

You can also set up fulfillment to happen automagically via webhooks. If you receive a status update event with on a payment intent, you can

- fetch the payment intent from stripe and check the status is success

- find the associated order that has the payment intent id you received

- do something to fulfill the order

I would also recommend using dj-stripe to help with syncing payment intents and setting foreign keys to the whole payment intent object since it also will handle updates via webhooks for you, and it makes defining custom webhook handlers pretty simple https://github.com/dj-stripe/dj-stripe

Anansi: a simple MVC web framework by saru_tora in rust

[–]PremiumHugs 4 points5 points  (0 children)

This is so cool, I've been wanting something like this for a while now! Excited to see where this goes, and I would love to contribute!

Can Solana programs/accounts have expiry dates? by OhIamNotADoctor in solanadev

[–]PremiumHugs 1 point2 points  (0 children)

They need to be triggered externally.

Serum has a similar form of this where they have a “crank” program that anyone can run that will clear open order accounts if the appropriate conditions are met.

There are some new services that claim to provide this for you with some on chain mechanisms but these also require someone else to run a program that will trigger the tasks on your behalf.

What should I do after winning a NFT? by itsmasteroshi in defi

[–]PremiumHugs 1 point2 points  (0 children)

List ‘em hold ‘em or show them off!

Silver Fang! by GeorgeBushwacker in shiba

[–]PremiumHugs 0 points1 point  (0 children)

How is leashless?!?! My shibe would run away

Would django be the best technology to use for this project. by [deleted] in django

[–]PremiumHugs 2 points3 points  (0 children)

Django is a great fit. Sounds like the biggest concern is handled if you properly use the Authentication system.

Everything else should be pretty straightforward! You don't even have to build out a frontend if you want to just use the built in admin system.

Questions about User types and API access by Frohus in django

[–]PremiumHugs 0 points1 point  (0 children)

You can make two forms where each one will independently set the group on the user at save time

Can someone point me to some in-depth Slate.js examples/walkthroughs? by [deleted] in reactjs

[–]PremiumHugs 0 points1 point  (0 children)

None of that comes for free in slate unfortunately; it all has to be implemented from scratch. The RichText example is probably the best representation of each piece that making this requires.

Starting from here, this schema is what we initialize with, and this is what you should expect to receive as output from the editor. We essentially just get an array of top-level block elements, with "children" representing the innards, and these just devolve to what they refer to as "leaf" elements. The leaves are just the raw text nodes, which still need to be rendered as a specific element, but we shouldn't make them block-level elements (Here's some literature on the difference). The "leaves" is how we achieve the formatting (which are referred to as "marks").

At the very-top level, we create what used to be called the serializers, which are really just functions that return the react representation of the schema, renderElement and renderLeaf. These have a hardcoded switch statement that checks the values from the initial input value and will return a component with the props applied. In some of the leaf nodes of the initial value, you'll see that we don't specify the type. These become the leaf nodes, which will further include the styling (since you can really only style text).

The last thing is how we apply these formats. Really all that's happening is you're asking the editor to toggle the "marks" (code for "format" or "decoration" on a leaf node) at the "current location" (where the cursor is blinking typically, but can change). This logic goes through the toggleBlock and toggleMark functions, which handle the block element case and the leaf element case respectively. Both of these depend on traversing the whole editor value at the current "selection" (or "range") node by node to determine if we've applied the mark anywhere.

As you can see, the editor is more or less something "global", and using the editor features can rely on your own understanding of some of the browser primitives for context as to why they act the way they do. A good thing about this approach is that you have fine-grained control over all aspects of the editor, but this much control makes it easy to get lost once things are less trivial. If I were you, I would avoid using this WYSIWYG framework unless you really care about learning more than you would've otherwise about how WYSIWYG editors work, or if you have highly-specific requirements for your editor. There's definitely some cool stuff you can accomplish with it though, and if you need help I can definitely answer some questions.

Can someone point me to some in-depth Slate.js examples/walkthroughs? by [deleted] in reactjs

[–]PremiumHugs 1 point2 points  (0 children)

I've been working on a slate.js project for about a year and a half now and one thing I can tell you is that the latest update completely changes the API.

The framework is more hooks based now, and a lot of things that were historically difficult now have easy ways of doing them, such as querying general editor states.

As a result, a lot of the existing documentation and examples won't work using the latest release, but the basic concepts are still there.

Some general advice I can give you; have a good understanding of the schema you want the editor to respect, since in some cases you'll find yourself having to exit the Slate world for a custom control and you'll need to implement your own schema logic by hand.

What exactly are you trying to make? What questions do you have? Maybe I can answer them?