title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
|||||||||||||||||||||
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white. As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green. |
||||||||||||||||||||||
Friday, May 30, 2025 | ||||||||||||||||||||||
Note to self: It's pretty easy to get a Stripe CheckoutSession in .NET. I talked about writing a Chrome extension and integrating payment through Stripe a few months ago. Unfortunately the "what appears to be an amazingly well-written howto" wasn't, quite. So here's a quick bit of play with the Stripe API using .NET. This looks up information according to a "Checkout Session" id, which is what you'll get sent if you set up a "After Payment" processor URL, which is what I'm doing -- for now in an Azure Function, just to be kewl. (No, you shouldn't use hard-coded paths in your code. No, you shouldn't pass around anonymous classed entities in C#. You're right, there's one instance of insanely not-DRY-ness in this code that almost bugs me. And I hate kludging Steps:
I'd been thinking about having a $3/year [sic] subscription for an extension. After a test, I learned what the comments, above, mention: That'll cost me ($3 x .029 + 30¢ somehow equals...) 41¢ [???] per transaction. Okay, apparently there's a "Usage fee" in addition to the charge?
From togai.com:
From bossrevolution.com:
Cool cool. 13 2/3% of $3. Just below Apple's small dev 15%. Good times. Least the API is simple. More to come. From stripe.com:
good heavens. Labels: .NET, c#, example, noteToSelf, stripe posted by Jalindrine at 5/30/2025 01:26:00 PM |
||||||||||||||||||||||
Monday, May 26, 2025 | ||||||||||||||||||||||
Sometimes, I surprise myself:
Labels: development, noteToSelf posted by Jalindrine at 5/26/2025 03:32:00 PM |
||||||||||||||||||||||
Monday, May 19, 2025 | ||||||||||||||||||||||
I'd missed the whole Forced Reset Trigger debate over the last year or so, but caught an article about it in The Post Sunday and figured I'd see what it's about. Here's what I learned, executive summary style.
My second isn't quite accurate, but check below and it'll make more sense. First, some YouTube videos and then quotes from an excellent article from the National Association for Gun Rights. The first shows the trigger in action with some slow-motion demonstrating that a trigger pull is required for each round. But it also is what reminded me of bump stocks. Again, it's not. The bump stock would essentially (afaict, ymmv) push the gun back into your trigger finger so you didn't have to manually pull. It looks like this does something similar but you do have to pull the hairiest trigger possible. This one shows me two things: The eyes of the first guy shows it fires lots faster than the novice shooter can normally. The second shooter shows me it does take a knack -- easily achieved, but a knack -- to get it to work. This one, however, is probably my favorite. This fellow shows that he can empty six rounds just as quickly using a traditional trigger. Dude is fast. Now for some quotes from that article from the National Association for Gun Rights. The last one is pretty telling. They're comparing the Force Reset Trigger to a binary trigger, the second of which also increases discharge rate, but in its case by releasing a round with a pull and a release, thus the whole "binary" moniker. But we learn a decent amount about how actual shooters consider the FRT.
That last point (and the "fun range accessory" comment) seem to wrap this up for me. In the wrong hands, a FRT could enable someone shooting at a crowd to cause a lot more carnage than without. For the serious shooter or someone truly interested in eliminating a specific threat, there is no practical usage. That is, unless your adversary was coming at you in waves like an 18-century bayonet charge, it's likely a bad idea to use a FRT for security. Honestly, I'm still surprised we have a sort of bifurcated Second Amendment. District of Columbia v. Heller is described at today's Wikipedia like this:
... but there's also otherwise an argument that anything goes. I mean you can even have a fully automatic rifle (as the NAGR references) if you jump through enough hoops. Okay, I realize that's a law, so not 2nd Amendment protection, but in general it feels like "if the Army can own it, so can I" argument comes up more frequently, like with sawed-off shotguns, iirc. That is, in 1939 SCOTUS said:
But I think I saw an argument that since the Army now assigns shotguns in specific urban missions it's fair game for everyone. But even the text, above, seems counter to Heller: The bar there is "Is this weapon useful to a militia?" not Heller's "Is this something a citizen would have at home and bring to a militia?" Anyhow... And, as I think I mentioned before, years ago I went to a local gun show to see how tough it'd be to get an AR-15 fully auto. There was a bin of the piece that you'd need to replace to make an AR-15 fully auto and a $10 or so book explaining how to do so easily available. For $1500 or so, you could walk out and be an hour or so away from an fully automatic M-16 equivalent. The question of whether a FRT should be illegal comes down to how you interpret Heller. I don't know that Heller is talking gun technology. That is, a flintlock musket or rifle (two different things) are nothing, not really, like even a lever-action rifle today. If you'd had a lever-action from 2020 or 1970 in 1770, you would have been a power like no other, not just for rate of fire, speed of round (so velocity and inertia -- damage), but also accuracy. I think Heller is saying more, "What sorts of weapons do you have around the house today?" rather than "Gun technology stops at 1791". Even then, NAGR would suggest the FRT isn't one of "the sorts of lawful weapons that they possessed at home" when it says "the FRT is often seen as a fun range accessory rather than a practical tool". When it comes to hunting, they add, "When tracking moving game, accurate follow-up shots are often more critical than speed. The binary trigger provides the time and control necessary to line up subsequent shots, whereas the FRT’s rapid reset can make it more difficult to stay on target." But this does argue for the binary trigger being legal, I believe. (Strangely, binary triggers appear to be illegal in Florida and Alabama, among other states.) The weird deal the ATF made with the makers of the FRT is a weird middle ground. I assume it's just a punt. From The Post:
Once the patent or whatever is out, are we back to where we started? Regardless, this seems to support where I think I always end up on this one: If you don't like our current state, you've got to amend the Amendment. Labels: guns, Other Stuff posted by ruffin at 5/19/2025 08:41:00 AM |
||||||||||||||||||||||
Saturday, May 17, 2025 | ||||||||||||||||||||||
From Hacker News' Malicious npm Packages Infect 3,200+ Cursor Users With Backdoor, Steal Credentials:
None of this is amazing or rocket science, which is exactly why it's important. It's not hard to social engineer humans. It does make me wonder about the almost unthinking preference devs can have for "[I don't care if it's] NIH". Not that it started with But if you want to reduce your proverbial footprint, there are ways. Knowing open-source libraries you use well enough to have contributed is one. Not writing an in-house version of something insanely trivial is another. And, as much as Apple's getting slammed for arguing for its own nanny state right now, using IDEs from fairly reputable sources and not believing deals that are proverbially too good to be true are all probably decent ideas too. I do wonder about, say, browser extensions. I have one from the EFF on one box that I haven't looked into for a while -- is it still be updated? What do adblock extensions really do? Luckily these are all in JavaScript so, even if obfuscated, you can still sniff through most of them fairly easily. Somebody should know, eventually, if the most popular get wacky. Right? Though heaven help me if the right vim plugins for IDEs get compromised. I'm toast. (Told ya it was easy.) Labels: development, npm, security posted by ruffin at 5/17/2025 02:08:00 PM |
||||||||||||||||||||||
Wednesday, May 07, 2025 | ||||||||||||||||||||||
Coverage reports in C# with Cobertura In the last contract I completed, we were building WebAPI microservices in C#, and part of our build process was to run all of our XUnit (and, depending on who originally wrote the microservice, maybe NUnit) tests and use SonarCloud to produce a pretty amazingly specific coverage report that highlighted every source file's test status, line-by-line. I've got a personal project in C#, have been spending time recently writing tests for it, and wondered if I could pull off the same level of coverage testing. Turns out I can! Exactly the same! Install by adding a ref to the coverlet collector to your testing proj:
Then run the test with this:
And sure enough, there's a new folder with every run in my Now the XML isn't very interesting.
You have to turn that into a more interesting report. This Stackoverflow answer explains how:
From the README: Install:
Run:
which, in my case, if I'm already in the same folder as the
... which, because we said so in the options, creates a folder named And then that report looks incredible: I have no idea why I redacted so much of that. Also note this is running against a very early stage piece of code. This coverage is obviously horrendous. But the coverage report isn't! posted by Jalindrine at 5/07/2025 05:47:00 PM |
||||||||||||||||||||||
Tuesday, May 06, 2025 | ||||||||||||||||||||||
From "Amazon now has a ‘Get book’ button in its iOS Kindle app" on theverge.com:
I just tried. It's there, and, though obviously easy in retrospect, the implementation surprised me: Kindle iOS kicked me to Safari, which I keep in private mode, and the "Buy with one click" button is activated. Okay, well shucks. Upon further review, apparently I don't usually pay much attention to that button, because it's always active, even if you're not logged in. Click it and it asks you to sign in. But I wouldn't expect that to last long. Right now it looks like Amazon is only adding Adding a one-use, unique "buy now token" would make it easier to buy using Kindle than Apple's own Books. I click buy in Kindle, I click a "buy now!" button in the browser that's opened (no Touch or Face ID required), and a universal link sends me right back to Kindle. And this would change our relationship with the web on our phones by merging apps and the web in ways I didn't really picture before. Now, Amazon knows where you were when you considered buying a book. They can do an okay job of fingerprinting you, not that they couldn't with you signed in within the app, but the extra data doesn't hurt. And, app review psychosis aside, there's no way for Apple to protect you beyond the way they protect any other surfer on Safari. (And with other default web browsers now on iOS, they can't always even do that.) This is a pretty significant wall breaking down in the garden. I'm still tempted to think it's a huge positive for devs and users, but watching the platform regain its equilibrium will be fascinating. That said, I feel like universal links are about to get overhauled. Apple might soon say...
Ugh. Tim Apple strikes again. (Though I haven't heard of them changing the rules there yet. You think Tim Apple's Apple (vs. Phil's Apple) would've had those universal link rule changes in the license already.) posted by Jalindrine at 5/06/2025 09:46:00 AM |
||||||||||||||||||||||
Wednesday, April 23, 2025 | ||||||||||||||||||||||
If you needed an excuse to get on your Apple high horse, I got a new one yesterday. My super old Android phone -- used essentially only when running for... reasons, mostly Pokemon Go reasons -- popped to its last page of apps after I unlocked it today just long enough to show three new apps there before it snapped back to the first page. Real useful ones like Slotomania and some tiles game. I didn't realize getting apps slammed onto your phone was a thing. But it is! And has been for over a decade!
What the absolute heck? I've always sort of thought of internet-enabled devices as ecosystems where code fought it out for resources, especially after the Sony rootkit CD scandal. This is similar, I think. My Android has a TextNow SIM in it now, for which I pay a total of $5 annually [sic] for a static number plus unlimited calls & texts, and, though unlocked now, the phone originally came from Tracfone, which still has a splash screen on startup and an app that I apparently can't erase, or can't erase without a lot of googling I'm not excited to do. Maybe it's Verizon, since they bought Tracfone and they apparently install stuff without asking? Maybe? But what a dumb, invasive, short-sighted way to squeeze a few more cents of revenue out of your users. I don't think iOS lets this happen. That it can happen on Android is "low key" (as the kids say) an argument against 3rd party app stores, which these carrier apps have essentially become. Ultimately I don't know where these stupid apps came from, but at least I'm not hallucinating? Labels: android, app store econ, ios posted by Jalindrine at 4/23/2025 06:05:00 PM |
||||||||||||||||||||||
Thursday, January 16, 2025 | ||||||||||||||||||||||
Okay, hopefully you're not letting your cat do this, but that's funny. Any time I use regex, I worry that I shouldn't. It's good, I think, for very targeted uses, and there is a wide swath of support through multiple tools, like XUnit's posted by Jalindrine at 1/16/2025 11:54:00 AM |
||||||||||||||||||||||
Monday, January 06, 2025 | ||||||||||||||||||||||
If you believe a post on reddit titled, "UPDATE: Apple Watch Series 3 LTE *CAN* Call Emergency Services without an associated phone plan", you can call 911 with a cellular/LTE powered Apple Watch even without having an active service subscription for cell service. But you might have to wait a while for the call to go through.
If true, I see an LTE watch in my future. I run around with an old Android with a TextNow SIM in it in case I need it, but emergency calls only might be enough to finally leave that at home. Labels: 911, apple watch, cellular posted by ruffin at 1/06/2025 05:59:00 PM |
||||||||||||||||||||||
Tuesday, December 03, 2024 | ||||||||||||||||||||||
Okay, let's write a Chrome extension. I've done this before, but couldn't really remember how, and since "manifest version 3" for Chrome extensions is some sort of big deal that changes all the rules, I might as well start over. Google does have a "Hello World" tutorial here, but it's important to note that the "Hello, World" extension is what at least this answer at SO calls a popup extension. (It also has some broken links to, eg, its sample extension icon, but you can get it all from the GitHub repo they link to.) Getting the devtools window up for a popup extension, like in that tutorial, is kind of a pain. You seem to have to first invoke your extension to show the popup, then right-click the popup, and finally select Inspect, which isn't super-easy to do. In fact, getting the correct dev tools window open is continually a source of pain for me. Popup needs inspect, an "action-only" background process extension needs it opened from the Let's take a closer look. Create an action-only extensionIf you want to simply perform an action (aka, "run a script") when the extension's taskbar button is clicked, you follow this example from Google's docs. Though it's "action only", the info for what to execute doesn't live in the An action-only extension reduces to this: manifest.json
Then simply add an event listener for the extension's "button" to your
To be clear, that's all you need to have for an extension, those two files, In this case, without a popup, you open devtools by clicking the link within Inspect views
service worker on the Extensions page (that is, what's displayed from the That said, once you have it up, though there is a "refresh" button for extensions, you can make edits to the javascript file and have it refresh during your next action run (afaict), so you're up and running for a while once the tools are open. Manipulating the tabOkay, chances are pretty good that you want to interact with the content of the page. I don't, but let me point you in the right direction. You're going to want to get used to your new friend, That might be most easily done by reviewing Google's Page Redder extension sample over here on GitHub. In brief, the code is this: service-worker.js
manifest.json
Now, if you want to access in-scope dev tools, you need to open them as you normally would from that tab with F12. Allowing the user to select optionsThe next thing I wanted was to add user-defined options. Interesting that it requires (Not that I'd do anything super-nefarious, but maybe I'd store the last time I showed an advertisement page or might store than that've paid a subscription with some sort of key or something. My point is that the possibilities are many, and before I thought I wouldn't allow myself to consider them.) Anyhow... I'm not showing a full page UI (though that's an option too), so I'd include a new UI file (
Asking for moneyI haven't really given this a good look yet, but I did learn that, unlike Safari on Mac, Google no longer lets you charge for the installation of an extension from their store. There's what appears to be an amazingly well-written howto for building a Stripe-integrated license checker for free at Cloudflare at this blog post, "How to create a paid Chrome browser extension" from earlier this year. Labels: chrome, chrome extension, extension posted by Jalindrine at 12/03/2024 10:06:00 AM |
||||||||||||||||||||||
| ||||||||||||||||||||||
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
![]() |
|
|