Some digging into embedding comparable images

I recently had an idea to compare two images side by side and ideally having a slider present to be able to see one more than the other. I wanted to get to a MVP of this but after spending a couple of hours, I decided to just jot down my notes about it so far and move on. Another reason is that I’m trying to make this blog into a thought stream instead of just polished posts of some kind.

Examples of embedded objects

This Spotify embedded object is a great example of both functionality and style, it looks and feels like using the Spotify app and it’s easily embeddable.

Some places like WordPress only allow embedding from certain URLs and others like Notion allow embedding anything that doesn’t block embedding, see a screenshot below:

↑ Embeds in notion ↑

I tried a couple of different techniques to try to get two images to be comparable, you can see them in this codepen: https://codepen.io/usmanity/pen/dyYaVpY

Unfortunately, I couldn’t get a working version of it because my approach has been mostly CSS-first and I didn’t want to spend too much time writing JS to handle different parts of the dragging. One attempt I had was to watch drag and other events related to it, more here: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
This approach didn’t work because draggable is great for moving around elements but there was still no good way to get the difference in dragging unless I spent a fair amount of time calculating differences between the starting point and where the dragged slider was.

I also tried a border size and range input approach, basically use the value from the range slider and set that as the border size, but this didn’t work because the border would increase while decreasing the size of the image itself.

My next attempt will be to use a background size approach but right now I feel pretty burnt out by the past few approaches so I’ll wait on trying that.

Reminiscing on a decade of cryptocurrencies

Cryptocurrency is one of the weird internet hatchlings that has gone from an esoteric project by an unknown guy to a financial industry that trumps many central banks around the world. It’s also one of the few areas of the internet where I got interested pretty early on.

Back in 2010, a friend of mine suggested I install a “bitcoin miner” on my pretty basic macbook pro (a 13″ 2009 macbook, specs were ok to use a browser). Over the next few days, it successfully mined something around 1.5 to 2 bitcoins, I don’t remember the exact amount. He suggested I get a “wallet” to keep it in. But, this didn’t make any sense to me, how can a digital hash generated by some random program have any money linked to it? Boy was I wrong. Well, a few weeks passed, this program kept running and I decided it was taking up too much CPU and RAM to work so I closed it. And then, a few days later, uninstalled it. And with it, went the 2 or so bitcoins I had stored in it. You might be thinking “dude, you just deleted $10k or $20k worth of money like that?” and the answer to that is no, I deleted what was essentially 5¢ or maybe 25¢ worth of money at the time. Additionally, there was no real way to turn that into real USD that I could do anything with. But, that’s the point of this, if it has potential for being something valuable later, it doesn’t mean that value is visible right this moment.

The next big moment in my crypto history came when Coinbase launched. I remember back then Brian Armstrong would send you 0.1 BTC just for joining. That was worth about $0.99 when he sent it (it shows in Coinbase transactions history). Well, I wanted Kristen to join Coinbase too so I sent that over to her. Eventually I also sent her $5 worth of Ethereum (later when it was added), which at the peak in 2017/2018 was worth $170!

The concept of crypto faucets might be familiar to some but they’re not around much more now. Akin to an internet version of a river of gold or diamonds, faucets would give you a small amount to deposit into your crypto wallet. I remember clicking random websites that would give you Bitcoin, Ethereum, Ripple, etc but never really anything more than a few cents worth. It was playful at most, not something that would give you a ton of money in today’s terms.

When Stripe partnered with Stellar to give out Lumens (XLM) to early adopters, I got 3,000 of them and at the peak of 2017/2018, it was worth about $0.90 a pop, I decided to hold and that again was a mistake, now XLM is moving between $0.08 and $0.12. I’m still holding on to that original grant since there’s no real advantage to selling it after all this time. But I believe Stellar has peaked since its use case of being a money transfer only currency is not really the highlight of cryptocurrencies.

Recent crypto activity

This is not advice but mostly my approach in crypto. I believe bitcoin has had its time, after 3 halving events, a couple of forks, and repeatedly proven slowness, it has had its time in the limelight. Ethereum still seems to be the front-runner but it might become challenged by the many different projects that rely on the network and will eventually run into a bottleneck of some sort. Ethereum’s contract system is probably the most useful part of the network.

Where Stellar and Ripple tried to be the Western Unions of the internet, there are attempts at any sort of use case possible right now with cryptocurrencies. For example, Handshake (HNS) is attempting to be the DNS and certificate authority using peer-to-peer DNS instead of centralized systems like Cloudflare. I also hold a bit of HNS but don’t expect it to return dollar returns and instead be useful to buy my domain (usmanity) in the crypto world world as well.

I remember when Tether launched and I was confused as to why you’d want to have a parallel of American dollars in crypto. Overtime, this has made more and more sense as going from crypto to fiat is expensive and slow, Tether and others help keep this simple. Plus, no tax reporting is needed if you go from one crypto asset to another (as of my understanding of this in May 2020). Coinbase launched their own USD-tied asset, USDC, it’s way too closely named to USD and I believe that was intentional. Tether just generates more Tether coins which means a lot of the money is non-existent and the money people are storing in this is just helping prop-up the coin in the first place (aka all modern banks in one sentence). An interesting development on USDC is that it pays interest to hold it! There are other coins that give some sort of a “dividend” for holding them, Stellar pays a 1% inflation fee which is to help early holders not lose value over time, this is possible since Stellar has scheduled release of more XLM over time. Others like NEO give out NeoGAS, but my understanding of that is limited since I don’t care much about NEO, it’s an Ethereum replica IMO.

Back to USDC, it seems that Coinbase is acting like a bank because just like banks can prove they have money to lend, Coinbase can use the USDC stored by their customers and lend out some of that for margin trading on Coinbase Pro. I’m sure it’s also useful for other use cases like proving they have enough money to stay afloat if most of their customers decide to pull out the maximum of $50k per day all around the same time. Imagine if your bank had that limit, it would be chaos. In the US, you can withdraw as much cash as you possibly can but banks do report it to the IRS if it exceeds $10k.

My current holdings

So nowadays, I’m pretty risk-averse, with a global pandemic in full swing, bills to pay, and not really being confident about the economy, I can’t be throwing around money willy nilly but I do hold some cryptocurrencies, I’ve listed them below, starting with the most to least:

  • USDC, about $2k right now. In Coinbase, it earns about 1.25% APY which is negligible during a typical month. Sign up for Coinbase using my referral link to get $10 in BTC.
  • Tezos, about 500 USD equivalent. A staking based reward system which pays out 5% in Coinbase, very odd concept in that the rewards are paid for the first time after 40 days and then every 3-5 days.
  • Stellar, about 3100 XLM which is around $300 right now.
  • BAT, less than $50 worth at any given time. This is because I use it on the Brave browser. You can download Brave using my referral link which will pay me in BAT if you continue using the browser: link.
  • Various ones in less than $10: 0x, Ripple, Dash, Litecoin.
  • What about Bitcoin? I hold about $100 worth of Bitcoin right now. Using the Cash app to buy this since it is one of the most straight-forward ways to buy BTC. My referral link for Cash App.

I believe we’re still at the infancy (or maybe toddler) age of cryptocurrencies, there are new developments almost every week but it’s a financial tool so some people and institutions are afraid to get near it. This will change as digital payments and money transferring becomes as ubiquitous as sending an email, text message, or tweet.

Now Playing on Last.fm

For a long time I wanted to have a simple UI for viewing what song’s playing right now and then have a bit of information about so about a month ago, I decided to try building exactly that.

I’m using Last.fm’s API since it’s pretty simple to get an API key and start making requests with a username passed in, no authentication needed.

You can check it out here: Now Playing

Example song playing on now.usman.xyz

One thing I wanted in this project was to get to a “done” state and have it usable. Since it has been a long time that I wanted something like this, I knew exactly what the requirements were in my mind.

I used Svelte to build this since it’s so lightweight compared to Vue and React. After the username is set, I just save it to a cookie and use that in the subsequent sessions. I didn’t want to overly complicate this project.
Code is here: https://github.com/usmanity/now-playing

Killing analytics on my personal sites

Last year, I spent almost a full day setting up Fathom analytics to track my personal projects and this blog. It’s been just over a year now and after looking at my lackluster analytics 😁 I’ve decided to just stop paying the $5 a month to host the Fathom instance. It’s not worth even the $5, I’m doing something like 100 views on my blog and just about 100 on all others combined so in that case, I am wasting more effort maintaining the DigitalOcean box and paying a hefty amount for analytics.

This doesn’t mean I’m going to Google Analytics, that’s just a big no-no in my book.

Go be a Ranger, little Archie

Since last Thursday, we had been fostering a little puppy. We gave him the name Archie. He is a blue healer and Bernese mountain dog mix, so he’s going to be a big dog. Below is a picture of him.

We were fostering him because animal shelters are closing due to the coronavirus lockdowns everywhere. Kristen went and picked him up from Vacaville.

He was a little guy among a bunch of dogs there, the person Kristen got him from is a volunteer at a nearby shelter and she brought him home. He was sleeping outside and Kristen just couldn’t take it so she brought him home.

Archie was a name Kristen picked because it sounded cute for a big dog. We had started crate training him and he was whining a lot at night but getting better night by night. Our house is a mess because he bites and pulls on everything.

A few days ago, I brought up to Kristen that we can’t have a 3rd pet right now because of how much attention he needs while we’re also paying attention to our other two pets, Samson and Heisenberg. Along this, there’s also the fact that he was going to be a foster which made me not want to get too attached to him.

Well, we had gotten some replies on the craigslist post but most were either too vague to be taken seriously or people were just not serious about picking him up. After having him for a week, it’s hard to say bye to him and just let him go to any stranger’s home so Kristen was vetting each reply and making sure the people were actually serious about him.

Last night, she got a reply from a couple who live in Napa and they have a farm up there. They were interested in him because they had just put down their down dog who was very ill with cancer and pretty far along in his years.

They came by today and Archie met them. They asked us what made us name him “Archie” and we didn’t have any reason and Kristen said “His name was Ranger when we got him” and the couple choked up and started to laugh after a quiet moment and said “that was our dog’s name!” So that was it, they couldn’t stop petting him and holding him and he couldn’t get enough of them. He’s now on his way to his new home on a farm, where he’ll be another Ranger and I hope he lives his best life out there. And I do hope to see him when he’s all grown up, one day.

Having a foster is really hard, I don’t think I can ever do it again. A puppy is so loving and so attention hungry, there’s not much you can do to avoid loving them. I’m going to miss this little guy a lot!

Some more photos of him:

Update: We got an update from the couple who took him earlier today. They said he slept on the ride there. He met their other dog named Boomerang and tried playing with her. He met their chickens and walked around the farm. He loves running through the tall grass. We don’t have any tall grass but we had some plants that he ran through. I’m so happy he went to a farm where he’ll grow up to have tons of room. I miss him a lot. He’s so cute and so energetic. I will miss his subtly upset groan he would do if you picked him up while he was barking. They have a farm where there’s a huge area for the dogs to hang out when they’re not around and he has his own 6×6 crate to sleep in.

I am looking around realizing we try our best to give Samson and Heisenberg a good life and I believe here he would’ve been happy too but maybe not as wild as he will be there.

I believe it was meant to be for Kristen to pick him up last week and bring him here so he can find his way to the farm. He won’t be alone, sleeping outside, with nobody to play with. He will be doing a lot of helping and running around, not bored in the dirt in someone’s backyard. Thank you Kristen for showing me this.

He is now called Ranger.

Some songs that remind me of him, in some way I guess:

“Silent Way” by Milo Greene

“Genesis” by Jorma Kaukonen

March 25th, 2020

Today, I think the infected cases for coronavirus in the US are 3rd highest in the world and growing the fastest.

The puppy, Archie, is too much trouble. I forgot how much work it is to take care of a young dog. He’s extremely energetic. Samson is really annoyed with him too. And Heisenberg won’t be in the same room as him.

I hope people are staying inside.

Middle child syndrome and Bluetooth keyboard

I’ve been thinking about often I take for granted the lack of maintenance my pets Samson and Heisenberg require. So little that I never really think about the sound levels around our house. But since we have been fostering a puppy, it’s been way different. Archie is his name. He’s cute but so young he’s clumsy and every little sound grabs his attention.

So, I’ve been leaving behind my Bluetooth keyboard I use to write my long form stuff on my iPhone. Mostly to not make any sound when typing.

I’m pretty sure Samson has the middle child syndrome. He is quiet most of the day, doesn’t want to play, and he’s isn’t eating much.

I’ve not been keeping tracking of Coronavirus numbers but today I think they’re around 300k. I could be a bit off.

March 19th, 2020

I’m writing this to just vent about the current situation going on all around us now.

I don’t know how many days it has been since I’ve been working from home. I’m kind of feeling hazy about it all. Getting cabin fever but I suppose that’s better than getting coronavirus at this point.

The whole day is a blur, working, eating, cleaning, and anything just kind of happens in a fluid but unorganized way.

Today, California was put in a quarantine or whatever the word the governor used to sound less authoritarian. It’s pretty dire to know that 39-40 million people are now supposed to stay home, this will really push the limits of our infrastructure like internet and maybe even electricity since most homes were not using energy at the this level during off-peak hours.

Putting America’s largest economy on hold is going to be pretty drastic for the economy overall.