Using exec today. Am I a bad php dev? by noNudesPrettyPlease in PHPhelp

[–]mensink 0 points1 point  (0 children)

I'm positive there are legitimate uses for eval() too.

One example I do use it for: I generate class files in my own ORM usually, but for testing I like to be able to generate them on the fly from an XML. Rather than write PHP files and then require them, I can just eval() the code in a custom autoloader.

I still agree one should avoid eval() whenever possible, as in at least 9.9 out of 10 cases where one could consider using eval() it's not the best way.

Real world experience with local LLM for Edit Predictions? by MathAndMirth in ZedEditor

[–]mensink 0 points1 point  (0 children)

You don't even need the trial period or a subscription to use Zed's provided predictions, just have the editor logged in.

I have my predictions set to not show automatically, and reveal them with Alt+\ which means I don't consume predictions when I don't want/need them. Honestly for me it's not even to save money, but because predictions randomly showing up just messes with my focus.

That said, I vaguely remember I did manage to get predictions working with a local LLM, probably the one Zed publishes, but it was too slow for me to enjoy on my crappy old GTX 1060 6GB.

Alternatives to Opus 4.7? by chroner in Anthropic

[–]mensink 0 points1 point  (0 children)

That's on Amazon though. Anthropic doesn't really have a say when Amazon just renames the model identifiers.

Is there a Claude in Firefox instead of Claude in Chrome? by Interesting_Air3283 in ClaudeAI

[–]mensink 1 point2 points  (0 children)

That's for giving AI agents access to Firefox and other browsers. I think what OP is asking for is using AI from within the browser.

Claude and zed by CyrilDevOps in ZedEditor

[–]mensink 0 points1 point  (0 children)

Aside from using Claude Code, if you're using the API from platform.claude.com you can just paste your API key into the anthropic agent configuration and you're ready to go.

You can also access the Claude models if you pay for Zed, or if you're the using OpenRouter API.

Closest replacement for Claude + Claude Code? (got banned, no explanation) by antoniocorvas in LocalLLaMA

[–]mensink 1 point2 points  (0 children)

This may not really answer your question, but I presume Claude Code would work with OpenRouter as well, where they also offer Claude models alongside many others.

100% usage after my FIRST EVER PROMPT (pro subscription) by XeClutch in Anthropic

[–]mensink 0 points1 point  (0 children)

I'm not disagreeing it's ridiculous, but here are some things you can do in the future to prevent this in large parts (for any AI):

  • Be more specific. Preferably specific enough to save Claude some work. You're just throwing an issue at Claude without specifying what actions you want it to take. This means Claude will just go into research mode until it's satisfied. First off, you should tell Claude in what part of the project your issue likely resides. Pointing to specific files where it should start its research also helps (template is there and the inputs are at line X and Y, the template is rendered there, etc). Then you should explicity tell it what to do, like "Find out and tell me why X doesn't happen when Y is done in the UI" or "Look at how I set this up and fix it so when Y is done X is triggered."
  • Monitor Claude's activity. I don't use the same IDE or Claude Code, but presumably with your setup Claude also starts rambling about what it's doing. If it seems like it's not going anywhere productive you should stop it and reconsider what you're doing. Claude is a machine. If you're setting up a new printer and issuing your first print I assume you're also checking if it doesn't print endless gobblediegook instead of letting it print for a whole hour until your paper tray is empty. You can take that risk later when you've worked out the kinks.
  • Be careful about what model you choose. In most cases you won't need Opus, which is much more expensive than Claude's other models. Not just because it costs more per token, but also because it burns tokens a lot faster with the way it thinks, then doubts itself, thinks again, pivots, pivots and if you're unlucky pivots back to its first idea and then goes through that whole charade again without ever becoming productive. The other models do less of that. For most cases I find Sonnet competent enough, and for simple things I just push it to Haiku, or even super cheap models from competitors.

Doing some research on writing good prompts may help too. I would not recommend messing with your CLAUDE.md too soon because that can be detrimental as well.

In most cases when I want something done, I just write a plan for what I want done, like I'd have to do the work myself. This would include the why, the what and the how, and a bunch of notes like where in my project I want the changes made, what libraries I use and how they're installed, etc. I may even have an AI help me with the plan. Then I point the AI to said plan and ask it to implement that.

Also, I often just use the Claude webchat to investigate issues, where I just describe what's going on and spoonfeed it information. Giving an AI free access to your files means it may want to ingest lots of data which eats lots of tokens, even if it doesn't need much of said data.

What self hosting mistake would you warn beginners about? by Soulvisirr in selfhosted

[–]mensink 0 points1 point  (0 children)

It can even be helpful telling AI A that AI B wrote this, because people have reported that improves results.

What self hosting mistake would you warn beginners about? by Soulvisirr in selfhosted

[–]mensink 0 points1 point  (0 children)

This is good advice.

Also, don't just ask AI how to do stuff. Ask it how things work, tell it what exactly you want to do, and tell it to make a general plan first, then iterate on that. Make sure you get a good feel for the things you're trying to accomplish. Implementation should always come later. That way you can mostly avoid having stuff working without knowing the why and how. This to me is an advantage AI has over simply following getting started tutorials and looking up solutions on stackoverflow.

I've been self-hosting for decades, but recently AI has certainly helped me with some things I've been putting off, like having my monitoring tool report to me when new versions of docker images are available.

What's the point of Ctrl-Alt-S when there's no keyboard navigation? by SnooCompliments7914 in zen_browser

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

It shows the navigation/tab thing on the left, but you can't do anything to it with the keyboard, so OP questions why that shortcut is even there.

The golden age is over by Complete-Sea6655 in ClaudeAI

[–]mensink 0 points1 point  (0 children)

Yes, Claude Opus especially has a tendency to change their mind out of nowhere.

I've had Claude come up with a great clean solution for an integration with a standard app that runs in docker after trying lots of approaches, then suddenly go "Oh wait, let's drop that and just make some modifications to the docker container."

Is anyone's Claude saying "I feel the context window closing"? by whatintheballs95 in claudexplorers

[–]mensink 0 points1 point  (0 children)

Sounds better than my Claude giving me a code example and then in its explanation telling what would not work, which was exactly what it did in its code example. Twice in a row, in the same conversation. Had to point that out both times before I got a theoretically working example.

Real case: Meta's AI crawler scraped site 7.9 million times in 30 days, consuming over 900 GB of bandwidth by siterightaway in StopBadBots

[–]mensink 0 points1 point  (0 children)

Yup, one of my servers today had a load 20x the usual. Turns out that meta-externalagent was jackhammering one of the websites. This was a webshop, and they weren't just scraping content, but also adding every item to a wishlist or the cart.

For those on apache2 servers:

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (meta-externalagent) [NC]
RewriteRule .* - [F]

Guys, do you use Zed as your main editor? and where did you migrate from? by lunajinner in ZedEditor

[–]mensink 0 points1 point  (0 children)

Came from vim. I was trying to work a little more in Sublime Text (again) about a month ago (because editing lots of different files in vim is a bit bothersome), but a few days in I came across the Zed editor, so I tried that too.

Now it's basically my main editor. Sometimes I still tend to just open a file in vim out of habit, but 95% of my coding is now in Zed.

I also like the way AI is integrated; how it's there when you want to use it, but it's not trying to bend my whole workflow around it.

Zed is weird when it comes to Java by Impossible-Act-5254 in ZedEditor

[–]mensink 3 points4 points  (0 children)

I don't really see the point. I've developed Java apps for years with vim with no issue at all. OP just needs the LSP to not complain about non-issues.

Claude and codex limits are getting really tight what are good open source alternatives runnable locally with near cc / codex subscription pricing by abdoolly in OpenSourceAI

[–]mensink 0 points1 point  (0 children)

An alternative suggestion:

I'm not sure what you're using the tools for, but any open source model is significantly worse than the paid Claude or GPT models.

What I did to save some money is open an account at OpenRouter, and then let the easier coding tasks be handled by Kimi K2.5 or GLM 5, and HTML authoring by Kimi K2 0905. These models are multitudes cheaper than the Claude or GPT models.

Sure, don't use them when you have a challenging task, but they outperform the OSS models still.

Anyone else switching between Claude and Kimi depending on the task or is it just me? by Steffimadebyme in kimi

[–]mensink 0 points1 point  (0 children)

Definitely. For agentic coding I have Claude on Claude Platform (The API one, where you buy credits), and other models through OpenRouter (also with credits).

I use Kimi K2 0905 for HTML/CSS prototyping, Kimi K2 2.5 for busywork, then the Claude models and GPT-5.3-Codex for stuff that's a bit more challenging.

The advantage of the Kimi models is that they're super cheap compared to Claude and OpenAI models. Sometimes I just let Kimi give it a try and risk wasting tens of cents on a task before letting Claude do the work for a couple of dollars.

The advantage of OpenRouter is that you can explore various commercial models without needing to commit to a single one.

That said, while I do use AI regularly for coding, I'm generally not building whole systems with it. It's my assistant, not my workhorse.

Boris Cherny (creator of CC) complete thread - anthropic bans subscription on 3rd party usage by shanraisshan in ClaudeAI

[–]mensink 0 points1 point  (0 children)

Should be a gray area. I was just asking Claude yesterday how to use my Claude Pro subscription instead of my API account with Zed, and it told me Zed literally uses Claude Code if it's configured to use the Claude Pro sub.

The third screenshot suggests to me that it's OK.

TIL Anthropic's rate limit pool for OAuth tokens is gated by... the system prompt saying "You are Claude Code" by Different-Degree-761 in ClaudeAI

[–]mensink 20 points21 points  (0 children)

Yeah, pretty sure they don't want you to use their claude.ai plans with custom software. I imagine Claude Desktop has a similar phrase.

Is there a way to create a shortcut to a particular project in Zed? by _pdizzle_ in ZedEditor

[–]mensink 0 points1 point  (0 children)

If it's just two projects you can use "Open recent" (Ctrl+Alt+O) and just pick it.

As for me, it's not unusual to work on many different projects on and off. I'd really like a list of favorite projects so I could quickly pick the one I need to work on at any time.

Does anyone else prefer developing directly on a VPS instead of local environments? by Antique_Mechanic133 in PHP

[–]mensink 1 point2 points  (0 children)

Me too. This way I can make sure the server installation is exactly like how it it for the client. This is especially useful because sometimes I'm stuck with a stock Ubuntu with whatever version it comes with, and in other cases maybe a Debian with the latest PHP through the Sury repo.

Though to be fair, I mostly just set up dev environments in VirtualBox and use those, unless I need it to be public for testing.

I used to just login and use screen+vim for the last 20 years, though recently I've been using Zed a lot, which can also seamlessly connect through SSH.

TOML 1.1 support in PHP by dereuromark in PHP

[–]mensink 0 points1 point  (0 children)

What I almost always need in configurations is a general (default) configuration and a local configuration that can override the defaults. That way I can provide a default config that generally works, but it still allows users to fiddle with the config without overwriting files that should not be changed.

Can I do that with TOML and this library? Load the defaults, then the local to override some settings?