Get Latest Post In WordPress (Tiny PHP Code)

Here’s a useful code snippet in PHP for WordPress to get a link to the newest (latest, freshest… you get the idea) post in WordPress.

Code starts here:

$latest = get_posts(array('numberposts' => 1));
$url = get_permalink($latest[0]->ID);
echo "<a href='" . $url . "'>Click here and read our latest post!</a>";

Yeah, that’s it. Have a great day!

Shuffle – Work with a grid layout, sort pics, do…. it all… This is a great tool!

Shuffle is a really handy javascript for as they say on their website “Categorize, sort, and filter a responsive grid of items”.
Take a look at it because it’s worth it if you’re playing around with photos and grid.

Alexas_Fotos / Pixabay

There’s plenty of ways to sort and all kind of settings. So check this out if you’re in search of something like it.

https://vestride.github.io/Shuffle/

The Most Important Bookmarklet Ever!

You probably can relate to this. Lets say you’re surfing around looking at funny pics and then BAM! You’re like: “Where the hell is the piano? I want to play on this website right now!”.

Well, this is a life saver. Because, now you can just run this bookmarklet and BAM! You got yourself a nice piano!

Use the code in the bookmark on in the address field:

javascript:(function(){var js=document.body.appendChild(document.createElement("script"));js.onerror=function(){alert("Sorry, the script could not be loaded.")};js.src="https://rawgit.com/Krazete/bookmarklets/master/piano.js"})();

Win 7,8,10 Drivers for 802.11g 54Mbps 1000mW USB 2.0 WiFi (DealExtreme)

A couple of years ago I bought this Wifi antenna dongle from DealExtreme.

802.11g 54Mbps High Power 1000mW USB 2.0 WiFi Wireless Network Dongle
https://www.dx.com/en/p/802-11g-54mbps-high-power-1000mw-usb-2-0-wifi-wireless-network-dongle-35688#.WxC1q2utS9J

Years passed and I wanted to try it out a couple of days ago. I discovered that Windows 10 didn’t auto-install it. There was some driver-problem.

Also, there have been some discussions about exactly what kind of chip that’s in this device. It seems like the manufacturer using different chips sometimes for unknown reasons.

But I did manage so solve it with my device and here is how I did it:

The driver I needed was called:
RTL8187L_WindowsDriver_Win7_6.1316.1209.2009_UI_1.00.0145.L

As you can see in the driver name, it says Win7. But the driver was usable for me and I run Windows 10 64-bit.

IMPORTANT:
If you have plugged in this device, I suggest you uninstall it from Windows Device Manager and also unplug it.

Search Google for the drivers and download them from some site that you trust.
Again, the driver is called: RTL8187L_WindowsDriver_Win7_6.1316.1209.2009_UI_1.00.0145.L
(I downloaded from this link. not sure it’s safe. DL at your own risk)

After you have downloaded the ZIP file, extract it. But before you execute the installation. Set the install-file to run under Windows 7 compatible mode.

You do this by right clicking on the file and go into “Properties”. You’ll see the settings somewhere in there.

Run the installation, restart your computer and plug in the USB Wifi Dongle again. Hopefully it will use the new drivers this time.

VB.net: Get a String between 2 words(any text) inside a larger string – Supereasy!

First off, I didn’t not write this code. I might have modified it but I’m not sure since I’ve had it around for quite some time.
If you’re the creator, thanks! It’s been handy. And comment and I’ll add a “credit-link” in this post. 😉

The code to get the value, text or string or whatever you choose to call it is so easy to use, short and it’s handy in many different kind of applications.
If you’re writing a Scraper in VB.net, this is a perfect Function that surely will be useful for you.

Lets say you have a string with the following content:
"Erik Johan Jonas Johanna Martin David"

And you want to pick out the name between Johanna and David:

Dim FindIt As String = GetBetween(Haystack, "Johanna", "David")
MessageBox.Show(FindIt)

So, I used Dim in the same line to set up a string to store the text we’re picking out and then used the function called GetBetween to extract the text.
There will be spaces that you might want to use Trim on since I didn’t include the space as a prefix and suffix when using the GetBetween function.

The code is in the full post. Follow the link!

Continue reading VB.net: Get a String between 2 words(any text) inside a larger string – Supereasy!