Implementing social logins at Flare
You can now log into Flare and Oh Dear using your Google or GitHub account. In this blog post, you'll see the code that powers the social login feature.
Read more [flareapp.io]
Posts tagged with code
You can now log into Flare and Oh Dear using your Google or GitHub account. In this blog post, you'll see the code that powers the social login feature.
Read more [flareapp.io]
When reading technical blogpost around the web, you might have noticed that code highlighting is not always perfect.
Shiki is the code highlighter that uses the textmate parser VSCode uses under the hood. The code highlighting it provides is near perfect, even when using modern syntax. It supports 100+ languages (via our package Blade is supported too), and all VS Code themes.
I'm proud to announce that we have released three new Spatie packages that make it easy to use Shiki in your PHP projects:
We're already using this package to render all our documentation pages, our guidelines, and this very blog you are reading.
Join thousands of developers
Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.
No spam. Unsubscribe anytime. You can also follow me on X.
When a site is down, Oh Dear sends a notification every hour. Since last year, our notifications can be snoozed for a fixed amount of time (5 minutes, 1 hour, 4 hours, one day).
In the evenings and weekends, our users might not want to receive repeated notifications. That's why we've added a nice human touch: all notifications can now be snoozed until the start of the next workday.
In this blog post, I'd like to share some of the code that powers this feature. We'll focus on how the start of the next workday is calculated.
– gdebrauwer.dev - submitted by Günther Debrauwer
Generating one voucher code is easy, but what if you need to generate thousands (or millions) and you need to be sure that each voucher code is unique? In this post, I will explain how you can solve this problem (in PHP).
Read more [gdebrauwer.dev]
Bram Van Damme shows some code on how to do this.
Read more [www.bram.us]
A little piece of code I write often enough to mention. Pretty elegant IMO ? pic.twitter.com/F56izKw3hW
— Caleb Porzio (@calebporzio) October 9, 2019
Read more [twitter.com]
A nice insight by Basecamp engineer Jonas Downey.
Whatever ownership you have over an individual contribution is immediately forfeited the moment you commit the code. At that moment, the work becomes part of the ever-evolving organism that comprises a software system.
Read more [m.signalvnoise.com]
In the project that @freekmurze and I are working on, I needed the ability to replicate an existing Eloquent model into a different Eloquent model.
— Marcel Pociot ? (@marcelpociot) June 12, 2019
If you feel like this could be useful for you as well, here's the little trait for that:https://t.co/IXFpAsxE35 pic.twitter.com/fCccKmLdQs
Read more [twitter.com]
Konstantin Kudryashov, one of the speakers at the upcoming Full Stack Europe conference, makes the case for sharing new insights early.
When you build new feature as a team, and it requires a lot of new learning, do not hoard new knowledge in your head. Instead, incrementally commit each unit of learning into working code. Hide that partial logic behind a feature flag. The feature would be incomplete, but work-in-progress outputs will expose meaningful and demonstrable progress. To increase team’s awareness of outputs, add links into the feature tracker or documentation.
Read more [stakeholderwhisperer.com]
My colleague Seb wrote a cool package that adds tags and classes to code blocks in html, so they can be highlighted with css.
I created a spatie/commonmark-highlighter package that supports higlighting with CommonMark. After you register two custom renderers, all code blocks will receive a set of tags and classes, so they're already prepped to be highlighted by CSS when your content arrives in the browser.
Read more [sebastiandedeyne.com]
I love this little “owns” trait/method that @michaeldyrynda & I came up with for Confomo.
— Matt Stauffer (@stauffermatt) July 7, 2017
Look at that expressiveness. :kisses fingers: pic.twitter.com/dE731Ko1Zw
We think syntax highlighting makes the structure of code easier to understand. But as it stands, we highlight the obvious (like the word function) and leave most of the content in black. Rather than highlighting the differences between currentIndex and the keyword function, we could highlight the difference between currentIndex and randomIndex. Here’s what that might look like:https://medium.com/@evnbr/coding-in-color-3a6db2743a1e
Developers and their employers are often at odds over matters like clean or beautiful code and with good reason: neither ships a product or increases sales. Most end users don’t care what the code looks like, as long as the product works and meets their needs. That means that beautiful code goes out the window when the rubber meets the road and crunch time sets in.http://www.brandonsavage.net/the-case-for-maintainable-code/The fact of the matter is that framing code discussions in terms of beauty or attractiveness doesn’t help the case for getting code that’s clean. But there’s another way to frame the discussion that makes more sense, and achieves both the goal of writing clean code and meets the needs of most businesses: the concept of maintainable code.
Is a million lines of code a lot? How many lines are there in Windows? Facebook? iPhone apps?http://www.informationisbeautiful.net/visualizations/million-lines-of-code/