Schedule Randomness With Gelato, Witnet, API3, and Chainlink Vrf

Featured Imgs 23

From roulette wheels to action-adventure games, randomness plays a major role in the gaming world. It is for any scenario where opponents or scenes are created dynamically and for those where users need “on the fly” randomness.

This is a far cry from my memories of the 1980s, when gaming was a lot less enjoyable precisely because everything was predictable- if your character went on a mission once, the next time you played the mission would be exactly the same. As you can imagine, this got very boring very quickly.

Robust Hotlink Protection Strategies

Featured Imgs 23

For example, if you operate the website yourbusiness.example, you may have an image at https://yourbusiness.example/infographic.png that you use within your website. A hotlink is when an unrelated property (for example, the site anotherbusiness.test) embeds that image directly on their website by reference to your server, for example using the following HTML code:

WordPress 6.1 Retires Default Site Tagline in Favor of Empty String

Featured Imgs 23

WordPress’ default site tagline, “Just another WordPress site,” is now a thing of the past, though not yet fully retired to the realm of nostalgia. The recent 6.1 release resolved a ticket that lead developer Mark Jaquith opened 15 years ago to encourage people to change their taglines. The tagline has now been changed to an empty string for new installations. This was added as a note of interest in the 6.1 release post, which was the first place many learned about it:

“The site tagline is empty by default in new sites but can be modified in General Settings.”

For those who are sentimental about the tagline, rest assured that it has been preserved as placeholder text in the admin.

“I do think the easier solution is to replace the ‘Just another WordPress site’ value with a placeholder,” WordPress Core Committer Jb Audras said in the discussion on the ticket. “By doing this, we keep this sentence which is in my opinion part of the WordPress history —by doing so, it would at least appear on the Settings screen, so we keep this signature sentence somewhere on the admin— but the value is empty by default for new installs.”

This is the solution he committed, which landed in 6.1. The commit message identifies the reasoning behind the change:

Administration: Change default site tagline to an empty string.

This changeset replaces the default “Just another WordPress site” tagline with an empty string for new installations. The reasoning is:

  1. Not all themes display the tagline;
  2. Not everyone changes the default tagline;
  3. When people don’t see the tagline in their theme, they may not realize it is still visible in some places, like feeds.

The string “Just another WordPress site” and the related multisite string: “Just another {NETWORK} site” are now only used as a placeholder for the tagline admin option.

The advent of block themes was also another factor, since the Customizer was where users often managed their taglines in the past. Contributors concluded that the increasing use of block themes might result in more people who have the default tagline on their sites without even knowing about it. The conclusion was it is better to make it an empty string than to add a bunch of admin prompts to update it.

This is a welcome change to how taglines are presented, and it was past time to update it. Although most WordPress professionals had become accustomed to it, more casual users often searched for how to get rid of it, sometimes without knowing it could be customized. The message also wasn’t doing WordPress any favors, unless it was originally written to imply WordPress’ ubiquity on the web – a claim that was aspirational at the time it was first committed to core. In that case, it has long since served its purpose. An empty string ensures that the only taglines showing up for new installations are ones that admins intentionally wrote for their sites.

Tired of focus styles applying on mouse clicks? :focus-visible is the trick.

Category Image 091

Having focus styles for any interactive element is crucial on a website. Hidde de Vries:

Focus indicators make the difference between day and night for people who rely on them. […]

Focus outlines help users figure out where they are on a page. They show which form field is currently filled in, or which button is about to be pressed. People who use a mouse, might use their cursor for this, but not everyone uses a mouse. For instance, there are many keyboard users: a person with a baby on one arm, people with chronic diseases that prevent the use of a mouse, and of course… developers and other power users.

You don’t have to create your own :focus styles in CSS, although you can. By default, browsers apply their own styles to interactive elements. But if you don’t like that look, the temptation is to style your own. So if you do something like this, boom, we’ve got focus styles under our control:

button:focus {
  outline: 5px solid red;
}

(By the way, outline is a great friend to focus styles for reasons Manuel Matuzovic gets into.)

But by doing this, we’ve also done something else: we’ve made it so when you click (like with a mouse on a desktop computer, otherwise known as a fine pointer) those :focus styles apply to the element. This can be highly undesirable, leading to the CEO being all like why does the button change looks when I click it??? Fair enough, CEO, let’s fix it.

The trick is using :focus-visible which is relatively new but has pretty solid browser support. The whole point of it is applying focus styles that apply at all times an element takes focus, except when a fine pointer clicks it. Which is kinda perfect really. But if you’re nervous about going all-in on only using :focus-visible, a way to continue to use :focus styles too is to wrap them in an @supports block like:

@supports not selector(:focus-visible) {
    button:focus {
        
    }
}

Fortunately, the browser support for @supports and the selector() function is a bit better than :focus-visible, so this buys some additional browser support 🎉.

Pen:

The post Tired of focus styles applying on mouse clicks? :focus-visible is the trick. appeared first on CodePen Blog.

LEFT JOIN 3 tables with where date GROUP BY and SUM

Category Image 101

i have 3 tables : users, deposit, withdraw
table users :

id , username, referral
  1. 1, a1, null
  2. 2, a2, a1
  3. 3, a3, a2
  4. 4, a4, a1
  5. 5, a5, a2

table deposit :

id, users_id, amount, status, approve_date
  1. 1, 1, 10000.00, approve, 2022-10-01 14:52:53
  2. 2, 3, 10000.00, approve, 2022-10-01 14:52:53
  3. 3, 3, 10000.00, approve, 2022-10-01 14:52:53
  4. 4, 3, 10000.00, approve, 2022-10-01 14:52:53
  5. 5, 5, 10000.00, approve, 2022-10-01 14:52:53

table withdraw :

id, users_id, amount, status, approve_date
  1. 1, 1, 20000.00, approve, 2022-10-01 14:52:53
  2. 2, 3, 10000.00, approve, 2022-10-01 14:52:53
  3. 3, 3, 30000.00, approve, 2022-10-01 14:52:53
  4. 4, 3, 40000.00, approve, 2022-10-01 14:52:53
  5. 5, 5, 100000.00, approve, 2022-10-01 14:52:53

I would like to have the below end result, how do I combine the 3 tables together? The end result is sorted by SUM(deposit.amount) SUM(withdraw.amount) and where by approve date and search by referral . I apologize for couldn't display table data in a nice format for easier viewing. Thank you for your help.
what is try is like this sql code :

SELECT a.`referral`, a.`id`, a.`username`, SUM(b.`amount`) AS Total,SUM(c.`amount`) AS Totals FROM users a 
LEFT JOIN  `deposit` b ON a.`id` = b.`user_id` 
LEFT JOIN  `withdraw` c ON a.`id` = c.`user_id` 
WHERE 1
AND b.`approve_date` >= '2022-10-01 00:00:00' 
AND b.`approve_date` <= '2022-11-04 23:59:59' 
AND b.`status` = 'approve'
AND c.`status` = 'approve'
AND a.`referral` = 'a1' 
GROUP BY b.user_id,c.user_id
ORDER BY a.`id` DESC 
LIMIT 500 OFFSET 0

the result i want is like this:

username, total_deposit, total_withdraw

  1. a3, 30000, 80000

SSH vs X.509 Certificates

Featured Imgs 23

As a developer or systems administrator, you're probably used to SSHing into servers with key pairs. What if I told you there is a better and more secure way to manage SSH access? Think SSH certificates (And no, they’re not the same as TLS certificates)

For most people, their knowledge of certificates lies within the confines of the X.509 digital certificates format — also known as TLS/SSL certificates — used by browsers to enable HTTPS. However, the X.509 certificate is not the only digital certificate format that exists; there is also the less-popular SSH certificate format created by OpenSSH.

8 Steps to a Winning Product Strategy Made Simple: What You Need to Know

Featured Imgs 23

You built a product, and it’s working well. You might even achieve your goals and start making a profit. But how do you know when you’re done building it? When do you need to create a new feature or add a new marketing channel?

When you bring a product to market, you solve a problem for your users. But you’re not the only person who can solve that problem. In fact, you’re one piece in a much larger ecosystem — a network of developers, customers, and manufacturers — all working together to build a better product. It’s a complex ecosystem, and you need a product strategy that can help you navigate it. 

Unreveal Effects for Content Previews

Category Image 052

Some time ago, we explored a cover page transition that would hide some initial content and show another level of content, i.e. “unreveal” it. Today I’d love to share some more ideas for showing another page or preview, including one that uses CSS clip-path to achieve the effect.

This is our initial view:

When clicking on an item, we hide the current content by covering it with an expanding circle. Then uncover the preview by expanding a clip-path. This is the next view:

And this is how it all looks in action:

There are three different effects. Hope you enjoy them and find them useful!

Thanks for checking by!