Nikola Brežnjak blog - Tackling software development with a dose of humor
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Home
Daily Thoughts
Ionic
Stack Overflow
Books
About me
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Nikola Brežnjak blog - Tackling software development with a dose of humor
Quick tips

When espanso Breaks on Long Replacement Strings (and How to Fix It)

When espanso Breaks on Long Replacement Strings (and How to Fix It)

Hey friends 👋

Today’s post is a quick one, but it might save you from a few head scratches and keyboard punches if you’re an espanso user who’s been wondering why your juicy long replacement snippets randomly just… don’t show up.

If you’re wondering what Espanso is, check this blog post: Espanso: Because Who Actually Likes Typing Out Their Emails?

TL;DR ☕

  • Long replacement strings (>100 chars) can silently break in espanso
  • This is due to the default clipboard_threshold config
  • You can fix it by setting a higher threshold in default.yml

!TL;DR ☕

If you came for the story, here we go: so, here’s what I ran into…

The Problem: Long Replacements Just Break 🧨

I’ve been using espanso for a while now (it’s a neat little open-source text expander that makes typing repetitive stuff a breeze). All was fine and dandy—until I tried adding a longer replacement string, something like:

- trigger: ":some-long-snippet"
  replace: "Dear passangers, we have good news and bad news. Good news is we are landing. Bad news is we are crash landing!"

And poof—nothing. The replacement just didn’t happen. What’s even worse, it would usually trigger the command prompt in editors (similar to pressing CMD + k or CMD + p).

At first, I thought it was something I’d messed up in the syntax. I double-checked, triple-checked… nope, looked fine.

Then I started wondering if maybe the issue was platform-specific. I’m running the newest version on a up2date Mac. Thought it was some weird key combo or something – but, no.

So yeah, turns out…

There’s a Hardcoded Limit (But You Can Fix It!) 🛠️

After digging around a bit—and with a helpful tip from a fellow redditor—I discovered that espanso has a clipboard_threshold setting buried in the default.yml config file (located at ~/.config/espanso/default.yml).

And it looks like this:

# clipboard_threshold: 100

Yep, it was commented out by default.

So what’s this do? If your replacement string is longer than the threshold (default is 100 characters), espanso silently fails to insert it. No warning. No logs. Nada.


The Fix: Increase the Clipboard Threshold 🙌

To fix this, all you need to do is:

  1. Open your ~/.config/espanso/default.yml
  2. Uncomment or add the clipboard_threshold setting
  3. Set it to something higher, like 500:
clipboard_threshold: 500
  1. Save the file and reload espanso (if it doesn’t reload automatically)
espanso restart

And voilà, your long replacements now work like a charm 🎉

Conclusion

If you’ve hit this issue too, I hope this saves you some time. And if you’re just diving into espanso, maybe take this as a reminder to skim the config docs sooner rather than later 😅

Happy expanding!

Miscellaneou$

2024 Top Author on dev.to

…was pleasantly surprised to receive this in the mail today. Yes, snail mail 🙂

Thanks to dev.to for being thoughtful.

The post that got me the top author award was: Getting started with React by building a Pokemon search application

Happy Saturday!

Daily Thoughts

Hara hachi bun me

"Hara hachi bun me", a Japanese concept which means "Eat until you’re 80% full". While intuitive, it’s sad that one needs to be reminded of it.

Daily Thoughts

Discipline is also a talent

Those who say talent doesn’t matter are liars.

Those who stop at talent are failures.

Federer said it best:

Yes, talent matters. I’m not going to stand here and tell you it doesn’t.
But talent has a broad definition.
Most of the time, it’s not about having a gift. It’s about having grit. In tennis, like in life, discipline is also a talent. And so is patience.
Trusting yourself is a talent. Embracing the process—loving the process—is a talent. Managing your life, managing yourself.
These can be talents, too. Some people are born with them. Everybody has to work at them.

Daily Thoughts

Play for the fun of it

Isn’t it interesting that we often make our best score when we’re not trying to make the best score?

However, there’s something to be said about the fact that you play as you practice.

So, practice well and deliberately.

Once you do, you’ll see it’s not fun. Well, not all the time, at least. But, it has to be done once you enter the level of 1 percenters.

Why? Because only that will enable you to ‘just do’, and not ‘think’.

It’s a job, you say!? Welcome to the real world of professional X (where x is any profession) 😉

Daily Thoughts

The importance of failing

If all you do is succeed in each and every thing you do, you just may not be pushing yourself enough.

Failure reveals your true character.

James Clear said it really well:

"The secret to winning is learning how to lose. That is, learning to bounce back from failure and disappointment—undeterred—and continuing to steadily march toward your potential. Your response to failure determines your capacity for success."

Daily Thoughts

A fresh start

It isn’t easy to start a new (better?) habit, routine, diet, relationship. Yet, it’s not the history nor the events that shape our future the most, it’s the outlook, the mindset that we decide to have about them.

Daily Thoughts

Perseverance

Do you feel you’ve given your everything? Do More. It’ll pay off in abundance in due time.

Daily Thoughts

Have you read a book this year (yet)?

If the only thing you got from reading the book is one new/affirmed idea, it was very much worth your time. Multiply that idea by the number of books you read and all the years you’ll live and you’ll get a perfect compound interest formula (that you’ll often read about as well 😉

Miscellaneou$

Fireblocks Cryptocurrency Scams: A Real-Life Example

TL;DR

Beware of the crypto scams. Here I’m just sharing one that I just got from a site I never even heard of. Still not clear what could they do with my IBAN – assuming it’s just the first step in them trying to extract more info…

Anyways, stay careful 🤗

!TL;DR

The Email

Just so that this hopefully gets picked up by Google and people see it before it hits their email, I’m sharing the text of the email in full:

Dobar dan, I sam Monika Verbic, i predstavljam tvrtku Firebocks. Želim vas obavijestiti da imate neaktivan račun u našem sustavu koji je automatski otvoren 2019. godine.

https://blockchair.com/bitcoin/address/bc1q4cyj5ucd9xenehxyjjm24ycv84c44c4eyf50r8

Na taj račun je uplaćen bonus u iznosu od 250 eura koji ste dobili prilikom registracije. Nakon toga ste aktivirali sesiju automatskog trgovanja, a naš robot je obavljao trgovinske operacije na vašem računu tijekom 5 godina. Zahvaljujući rastu vrijednosti kriptovaluta u tom razdoblju, saldo vašeg računa trenutno iznosi 4670 eura.

Sesija trgovanja je završena, a prema pravilima naše tvrtke, registraciju je potrebno zatvoriti. Međutim, zatvaranje nije moguće dok na računu postoji pozitivan saldo. Zbog toga je potrebno prebaciti sredstva s ovog računa na vaš bankovni račun kako bi se registracija mogla uspješno zaključiti i izbjegli dodatni troškovi provizije.

Molimo vas da nam dostavite IBAN legalnog hrvatskog računa na koji želite primiti sredstva kako bismo mogli izvršiti prijenos. Ako imate bilo kakvih pitanja ili trebate dodatne informacije, slobodno mi se obratite u bilo kojem trenutku.

Hvala vam na suradnji!

—
Monika Verbic
Manager Fireblocks
https://www.fireblocks.com/

The crazy part? Someone who claimed to be Monika called me just before this email was sent (I hung up the phone as soon as the person started saying "you have a trading account with us…").

As crypto is becommoing more lucrative and even a household name, it’s not surprising that the scams are picking up in volume and also becoming increasingly sophisticated. Malicious actors continually find new ways to deceive unsuspecting victims. Recently, I received an email that’s a textbook example of a scam, and I want to share this experience to help you avoid falling for similar traps.

Too Good to Be True

The email, which claimed to be from a company called "Fireblocks," stated that I had an inactive account with a balance of 4,670 euros, earned through a supposed cryptocurrency trading bot. The message seemed professional and convincing at first glance, complete with links to a Bitcoin wallet and a seemingly legitimate website.

The twist? To "retrieve" the funds, they requested my IBAN (bank account information). This is a classic phishing technique—luring you in with promises of a large payout while stealing sensitive financial details.

Red Flags in the Email

  • I never signed up for such a service or company
  • Legitimate companies won’t ask for sensitive details like your IBAN over email.
  • Promises of free money are almost always scams
  • While the email included a link to a Bitcoin address and the company website, these are likely designed to create a false sense of legitimacy
  • Use of the letter "I" instead of "ja" in Croatian language
  • Misspelled name of the actual company
  • Use of a private Gmail account, instead of one coming from a company domain

How to Protect Yourself

  • Verify the Sender: Check the email address carefully. In this case, the address was from a generic domain, not an official company domain
  • Don’t Click on Links: Hover over links to see their true destination before clicking. Avoid clicking links in unsolicited emails altogether
  • Contact the Company Directly: If you suspect the email might be legitimate, visit the company’s official website and contact them through their verified channels
  • Enable Multi-Factor Authentication (MFA): Secure your accounts with MFA to make them harder to breach
  • Educate Yourself: Learn about common scam tactics to recognize them quickly

What to Do If You Receive a Scam Email

  • Do Not Respond: Never reply or provide personal information.
  • Mark as Spam: Flag the email to help your email provider filter similar scams.
  • Report It: Notify your local cybersecurity authority or anti-fraud organization.
  • Spread Awareness: Share your experience with friends and family to protect them.

Final Thoughts

Scammers rely on a lack of awareness to succeed. By staying informed and vigilant, you can avoid falling victim to their tactics. Remember, if something sounds too good to be true, it probably is.

If you’ve encountered similar scams or want to share tips for staying safe online, feel free to comment below!

Page 1 of 511234»102030...Last »

Recent posts

  • When espanso Breaks on Long Replacement Strings (and How to Fix It)
  • 2024 Top Author on dev.to
  • Hara hachi bun me
  • Discipline is also a talent
  • Play for the fun of it

Categories

  • Android (3)
  • Books (114)
    • Programming (22)
  • CodeProject (36)
  • Daily Thoughts (78)
  • Go (3)
  • iOS (5)
  • JavaScript (128)
    • Angular (4)
    • Angular 2 (3)
    • Ionic (61)
    • Ionic2 (2)
    • Ionic3 (8)
    • MEAN (3)
    • NodeJS (27)
    • Phaser (1)
    • React (1)
    • Three.js (1)
    • Vue.js (3)
  • Leadership (1)
  • Meetups (8)
  • Miscellaneou$ (78)
    • Breaking News (8)
    • CodeSchool (2)
    • Hacker Games (3)
    • Pluralsight (7)
    • Projects (2)
    • Sublime Text (2)
  • PHP (6)
  • Quick tips (41)
  • Servers (8)
    • Heroku (1)
    • Linux (3)
  • Stack Overflow (81)
  • Unity3D (9)
  • Windows (8)
    • C# (2)
    • WPF (3)
  • Wordpress (2)

"There's no short-term solution for a long-term result." ~ Greg Plitt

"Everything around you that you call life was made up by people that were no smarter than you." ~ S. Jobs

"Hard work beats talent when talent doesn't work hard." ~ Tim Notke

© since 2016 - Nikola Brežnjak