Adding auto-incrementing badges to icons in Bootstrap 4.0

That facebook icon that tells you how many new messages you have? Useful, huh? You don’t leave the page, and it gets updated. It’s a little trick done with a combination of SQL and asynchronous jQuery.

I needed to implement notifications for a few applications at work, so I’ve found a way to implement this with just a few lines of jQuery and an asynchronous call to the database.

I’ve put this example up on bootsnipp:

https://bootsnipp.com/snippets/PDPN5

Check it out! On bootsnipp, it’s just pulling a number from random.org and refreshing for demo purposes, but the source of the number can be replaced with an SQL count(*) query.

Spread the love

R2-D2 iOT Lamp

Greetings! I have made an iOT thing:

r2d2
r2-d2 iOT nightlight!

Update: This project has been taken offline, but the project notes/source code is still available on github.

Currently, this little iOT Lamp is running on a pi-zero-w with a Pimoroni Unicorn pHat. The scripts are all written in python — some of which are the examples that come either with the Pimoroni BlinkIt or Pimoroni Unicorn, others of which I pulled from some of the Adafruit NeoPixel libraries, and yet a couple of which I wrote myself. The webserver itself is running right on the pi-zero-w — apache2 and php 7.2 — and is configured to launch an ssh connection from Amazon EC2 to my home R2-D2 lamp to send the commands.

The R2-D2 is a gutted nightlight from AliExpress.

I’m looking at eventually making this into an instructable!

Spread the love