Category: Technology

How to make a closable hover header div for your website announcements or ads using CSS and Javascript

html and css programming language pictureIt’s perfect for site news

In this tutorial you will learn how to make a “hovering” header for your website news, announcements or ads. I am currently using the same technique on this blog too and it should have loaded up by now. (not any more!) As you can see it can be easily closed by the red X button and it’s “hovering” over the main content so it keeps showing even when your users scroll down.

The requirements

This script uses Font Awesome and jQuery via CDN. This basically just means that you need to add the following code inside your <head></head> tags:

<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">

The HTML and CSS parts

This will be the face for your news box and you can customize things like font size, background color, padding, etc. Add the following code right after your opening <body> tag:

<div id="announcement">
<span id='message'>Your message goes here. You can add a link if you want or whatever you like.</span>
<span id='close'><a href="#" title="Close"><i class='fa fa-times'></i></a></span>
<div id="delimiter"></div>
</div>

* I’m using the delimeter div to clear both floats so it will not cause any styling errors.

Here is my CSS

Customize it to fit the design of your website!

#announcement {
    padding: 0;
    margin: 0;
    display: none;
    background: #CCFF99;
    height: auto;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
z-index: 9999;
}
#message {color: #000; font-size: 1em; float: left; padding: 0 2.1% 0 2.1%;}
#close {position: fixed; top: 0; right: 0; padding: 0 2.1% 0 2.1%;}
.fa-times {color: red;}
#delimiter { clear: both; }

* The position: fixed; along with top: 0; and left: 0; are what make the div hover over the main content. Same goes for the close button- just replace left with right to put it on the top right side of your page.

* z-index is a useful property because it specifies the stack order of an element. By giving it an unrealistic value we make sure it will stay on top of every possible element on your page.

* I’m using display: none; so that it will only display after Javascript has determined that the page is fully loaded.

* The fa-times class is for our close button. Font Awesome is really awesome 😉

Finally the Javascript

This is what makes everything work nicely! Add this code inside your <head></head> tags:

<script>
window.onload = function () {
document.getElementById('close').onclick = function(){
this.parentNode.parentNode.removeChild(this.parentNode);
return false;
};
}
$(document).ready(function() {
$("#announcement").delay(2000).fadeIn(500);
});
</script>

* I use the window.onload function to execute the script only after the whole page has finished loading. If your user is waiting for the page to load and at the same time a news box appears, it might scare away a potential client.

* You should also notice the getElementById(‘close’) and $(“#announcement”). Do not change these, they are the ID’s of the close button and the news box itself.

Share!

GreyRound theme is now available to download for free from WordPress

It’s finally accepted

I initially submitted the GreyRound theme for WordPress to review more than 4 months ago, but because this was my first ever attempt at creating a new WordPress theme completely from scratch, there were quite a few things I missed and I was asked to change those.

 

After hours of reading the WordPress Codex I was ready and submitted the 2’nd version for WordPress to review. Weeks passed… three weeks to be exact. I was very disappointed to see that there had been no activity around my theme any more. It later turned out that the guy who was supposed to review it for me had abandoned the thread- I guess he had other things to do…

 

So my theme got assigned to a new moderator called Poena after about two months. This is where things finally started moving somewhere. Many thanks to Poena for being a very supportive reviewer! She helped me through all the things I forgot to implement and when I didn’t know how to do something she first made sure I learned about it on my own and then proceeded to add her own ideas. I think it’s great that the reviewers at WordPress actually care about you getting better in your skills and help you learn like that. So after a total of nine revisions the GreyRound theme was accepted.

 

Download GreyRound 0.0.9

To download my first WordPress theme, GreyRound, simply visit the link below and don’t forget to rate!

https://wordpress.org/themes/greyround/

Share!

Travel in style with the worlds smallest Bluetooth headset device – YE-106S review

Whether you’re driving a car or riding a bike, this stylish and extra small headset will come in handy when someone calls you. Just push the button on the side once to answer a call, or two times to dial the last caller. You can even use it to listen your favorite songs or if your phone has an app for it- use voice commands to browse the web, read email and do all sorts of cool stuff.

ye-106s-bluetooth-headset-wirelessThe battery will last about 4 hours of constant use if you’re listening to music, but when it just sits idle and awaits for incoming calls then it can last a whole day without problems.

The in-ear shape fits so well in your ear that you don’t really need the transparent holder clip, but it’s still advised to use it especially if you’re out cycling because it MAY fall out of your ear.

The sound quality is very good although if you’re out in a windy or crowded place you may have to raise your voice a little for the other end to hear you better. It’s never been a problem though. Of course you can’t compare it with high tech headphones that have bass boosts and other features… but it’s still great.

It’s compatible with all devices that have Bluetooth. It worked well with my Samsung Galaxy Mini and the Galaxy S2 I fixed last year. My Windows 7 laptop recognizes and installs it as a YE-106S Bluetooth headset, but I haven’t figured out why it doesn’t work…

It’s definitely a great headset for the amazingly low price. You’d think it costs a fortune, but they go for $16.99 on Ebay– no joke.

Share!
Filed under: Gadgets, TechnologyTagged with: , , ,

The Alfa Network’s AWUS036H is a long range wifi wireless adapter compatible with USB 2.0 and Windows 7

AWUS036H overview

AWUS036NH is the IEEE 802.11b/g/n Wireless USB adapter provides users to launch IEEE 802.11b/g/n wireless network at 150 Mbps in the 2.4GHz band, which is also compatible with IEEE 802.11b/g wireless devices at 54 Mbps. You can configure AWUS036NH with ad-hoc mode to connect to other 2.4GHz wireless computers, or with Infrastructure mode to connect to a wireless AP or router for accessing to Internet.

It really is Long Range!

Ynef's cool gadgets - the AWUS036H Long Range Wireless Wifi Antenna AdapterSince my man cave is located quite far from our router I had to constantly struggle with the internet connection timing out and ruining my work because apparently the integrated Ultrabook wireless adapters aren’t all that great. I think the main reason my wifi kept dying are those damn concrete walls… In any case, I decided to go all in and get myself one of those long range antennas to never have to worry about my connection timing out ever again. It cost me $30 to get one.

 

Wifi connection improved instantly

Integrated wifi network adapter versus alfa network awus036h

Just look at all those green bars and let them speak for themselves! The Alfa Network’s AWUS036H vs. Intel Centrino- *headshot*

In case you are having trouble getting Windows 7 to install the device properly all you need to do is go to the Alfa Network’s official support page and download all the necessary drivers there for free and enjoy the long range wifi experience.

Share!

Rechargeable battery USB charger for Ni-MH rechargeable batteries

Out of batteries… again

Almost every cheap computer mouse uses batteries for power and if you are using one every day then you have probably been in a situation where the batteries suddenly die and you realize you don’t have any new ones to spare. Suppose it’s after hours too and all the local stores are closed.

Get Ni-MH

Ynef's cool gadgets - USB NI MH Rechargeable Battery Charger USB PoweredNope. The only sensible way to keep your mouse powered up at all times is to get two sets of Ni-MH rechargeable batteries– one set for working, the other for charging (and then switch between those). They have become so cheap nowadays that they will earn your money back in just a few weeks!

USB Charger for AA and AAA rechargeable batteries

To charge your new Ni-MH rechargeable batteries you will need one last thing- the USB powered charging unit for rechargeable AA and AAA batteries! For less than two bucks ($1.99 USD) you’ll have yourself the extremely useful charging unit that will save you a lot of time and money spent on regular batteries. You can get them from here: ynef.net/ebay/charger

It even switches itself off once the batteries are fully charged to avoid explosions and other crazy shit!

Share!
Filed under: Gadgets, TechnologyTagged with: , , , ,

How to add a Read More link on your content when someone copy pastes it

Everyone copy pastes!

Every day people copy and paste paragraphs, quotes and anything else you can imagine from one place to another online. Copy pasting has become one of the most common elements of social media as well because we all love to share something we think is cool with our friends. When was the last time You copy pasted something? Chances are you still have that data on your clipboard.

Get backlinks on copied content

How to add copyright read more link back to your site on copy paste text
At this very moment hundreds of thousands of people are sharing something via email, social networks, blogs and messenger apps by copy and pasting information. Wouldn’t it be awesome if your website would somehow automatically add a read more link along with the text that someone copies from your site?

It turns out there is an incredibly easy way to do this! All you need to do is add the following code just before your closing head tag. (it looks like this: </head>)

 

Copy and paste this code:

<script>
function addLink() {
//Get the selected text and append the extra info
var selection = window.getSelection(),
pagelink = '<br /><br /> Read more at: ' + document.location.href,
copytext = selection + pagelink,
newdiv = document.createElement('div');
//hide the newly created container
newdiv.style.position = 'absolute';
newdiv.style.left = '-99999px';
//insert the container, fill it with the extended text, and define the new selection
document.body.appendChild(newdiv);
newdiv.innerHTML = copytext;
selection.selectAllChildren(newdiv);
window.setTimeout(function () {
document.body.removeChild(newdiv);
}, 100);
}
document.addEventListener('copy', addLink);
</script>

I’ve turned the part that you can modify yourself red within the code so it’s easier to see. Just change that to whatever you like or remove it altogether to only have a link under the copied text. It’s up to you! The only thing you should keep are the <br /> tags otherwise the link will be added on the same line as the copied text and it makes it kind of annoying.

Note: I didn’t come up with the code myself. The original article can be found on StackExchange

Share!

How I fixed a Samsung I9100 Galaxy S II that was not charging any more for just $2.66

One day my sister came to me and said that her phone, the Samsung Galaxy S II, could no longer be charged. Something was apparently wrong with the charger port because when I held the cable at a right angle the phone lit up for a brief moment. Because the warranty was still valid I suggested my father to take the phone to the local shop where the phone was purchased and have them fix it… and this is where things got really stupid!

First he had to pay 20EUR in order to have them look at the phone. I figured out what was wrong with the phone in a few minutes, but it took them 2 days to finally call and say that the motherboard needed to be replaced and that the warranty would not cover it because they had concluded that my sister had broken it and it was no accident.

When my father asked how much will it cost to have the motherboard replaced, the tech guy gave a solid answer- 180 EUR. Obviously he didn’t pay for it because he had already paid them 20 EUR for looking at the phone and now they were asking 180 EUR more- the phone isn’t even worth that much as new!

While my little sis ended up with a cool new phone I decided to not give up and try to fix the Galaxy S II myself. How hard could it be?! So I opened up the phone and looked inside… I saw that the part of the motherboard that had a charger port could actually be easily disconnected from the main board. Upon closer examination I found some product serial numbers on it that I typed into eBay and this is what I found:

USB Charger Port Dock Connector Cable for SamSung Galaxy S2II i9100 i777 Rev 2.3
USB Charger Port Dock Connector Cable for SamSung Galaxy S2II i9100 i777 Rev 2.3

Charger Port Dock Connector Cable for SamSung Galaxy S2

I was shocked to see that the total cost for this part was just $2,66 USD. I couldn’t believe it was the only thing broken in the phone, but I placed an order just in case… I just HAD to try myself!

After about a month of waiting (item came directly from China) it finally arrived in the mailbox. I carefully removed the old one from the phone and connected the connector leaving it all open on the table just for the sake of testing it out… I was nervous a little… I carefully connected the charger to the phone… and IT WORKED! The phone started charging immediately.

What the… The professional tech support that we trusted would have taken 180 EUR (total of 200 EUR) for this? Wow… just wow. This is the last time I take anything to these guys. This experience inspired me to write this post and propose an idea what to do the next time a gadget of yours breaks down. Here it is.

PROPER way of dealing with broken gadgets

1. Try to fix it yourself

First of all analyze the situation. Try to understand what’s wrong and then try to fix it yourself with the knowledge you already have.

2. Learn how to fix it yourself

If you don’t know how to fix it at first, try to learn more about the device. How it works, what parts are required etc. It’s a fun way of learning something new!

3. Take it to someone who CAN fix it

If all else fails and you can’t fix it yourself you should probably take it to someone who can fix it. Try to find a tech nerd instead of a corporation though. Apparently they’re after profits and show little interest in actually helping you.

4. Recycle it

Sometimes things just die and there’s nothing you can do about it. If your nerd tech friend couldn’t fix it perhaps it’s time to say goodbye. Make sure to take it to a recycling center so it would be reused to make something nice.

In the monetary system people will rip you off

It sucks, but it’s true. Just like these tech support guys were after a gigantic profit you can easily get ripped off by anyone who values money highly. Remember, money is just paper. It doesn’t mean anything. I didn’t fix the phone with money… I fixed it with a spare part. Sure, it cost me $2,66 because we’re living in a monetary system, but you get the general idea 🙂

I definitely support The Venus Project and a resource based economy where money is simply obsolete and knowledge and a better understanding of how things work are the truly valuable commodities.

Share!

Watch our planet Earth from space in real time

This live stream of our planet was activated on board of the International Space Station in April 2014 as an experiment to see how well cameras and similar equipment handle the harsh space environment. Just look how peaceful everything seems from up there.

If you don’t see anything it just means that the International Space Station is currently on the dark side of the planet. (the area with no sunlight).

 

 

To read more about the experiment visit the High Definition Earth Viewing page (link missing, sorry).

 

Share!

Simple php guestbook script – Free download

I didn’t have anything better to do today so I decided to learn a little bit how to communicate with MYSQL databases using PHP. With this wonderful tutorial to help me I was able to construct a very basic guestbook script in about 4 hours. I know it shouldn’t take that long, but please keep in mind that this is my first ever attempt to create something like this with MYSQL and PHP.

Here’s a screenshot of the actual guestbook in action:

Ynef's random script screenshotAs you can see it’s very basic, nothing fancy.

You might notice that the title of my guestbook is ynef.net/b. Well, at first I wanted to create something similar to 4chan, but right now there is no option to post images- only text replies. I might add the option to browse and post images in the future when I learn more PHP.

What wasn’t mentioned in the above tutorial:

First of all if you follow the tutorial I mentioned above your script will work, but it will post an empty message every time someone visits or refreshes the page. To counter this I added if ($post != ”) right before the part where new posts are inserted into the MYSQL database.

This is a simple if statement that makes sure to only continue when the variable $post is not empty. Oh and don’t forget to put the code that inserts stuff into your database inside these brackets { }.

 

Another thing I added was the date of the post: $today = date(“F j, Y, g:i a”); Now you just have to echo the date variable $today along with your post.

 

I also tried making the guestbook a little bit more secure. By default if you follow the tutorial I mentioned your guestbook will be vulnerable to Cross Site Scripting attacks. In other words a bad person can submit malicious code along with his post and the next time someone visits the page that code will run. I looked into this briefly and I believe I was able to secure the guestbook by making sure that tags like <html> and <script> etc. are getting excluded when echoing the posts. It was really easy to implement with strip_tags();

 

Downloading and installing the free guestbook script

Download file: random.zip

 

Installing notes:

 

1. Open install.php in notepad and change the database variables to your own MYSQL database values

2. Upload install.php into your web directory and run it in your browser

3. Delete the install.php from your web directory

4. Open index.php in notepad and change the database variables to your own MYSQL database values

You can also change the title within the <title> tags and the guestbook name within the <h1> tags.

Yeah, I guess I could have just put the variables in one simple config file and included it in both install.php and index.php, but I was just too lazy.

5. Now upload both index.php and style.css to your web folder

 

If you followed the above steps then your guestbook should be working. If not please let me know!

Share!

Pendrive with very fast transfer speed and still affordable (ReadyBoost compatible)

The Verbatim Store’n’ GO Memory Drive

I just love small and compact technology and about a year ago I was in need of a new and fast flash drive for personal use. After a few hours of searching online I found that this fairly new Verbatim 32GB flash drive is exactly that. It’s incredibly small in size! Just look at the picture I took when I compared it to a cigarette:

 

Pendrive with fast transfer speed size compared next to a cigarette
Verbatim 32gb flash memory stick with fast transfer speed. Size is compared to a cigarette.

It might not look like much but this little baby holds 32gb of data, has USB 3.0 support and the average transfer speeds are as follows:

Write speed of about 10,5 MB/s

Read speed of about 21,5 MB/s

This makes it one of the best flash drives available for an affordable price of just around $40 to $45 bucks.

 

ReadyBoost Compatible Pendrive

Because of it’s high transfer speeds Windows 7 users can make use of it by applying ReadyBoost which will allow you to use a part of the flash drive as RAM assuming of course you have the USB 3.0 port on your computer/laptop (It looks just like a regular USB port but it has a distinct blue color, you can’t miss it).

 

Best Pendrive for live systems

For the geeks working with live systems and virtual machines, the Verbatim Tuff ‘N’ Tiny flash drive is a great solution. It’s small and fast- your live system is guaranteed to run smoothly on it. Not only that, but it has been built in such a robust way that even if a car were to drive over it, it would still be operational. It’s that awesome!

 

Storing personal photos, videos and other media

Whether you are a photographer looking for a way of storing your photos in a reliable way or an office worker who needs to keep files from work safely in their pocket, the 32GB Verbatim Tuff ‘N’ Tiny flash drive is more than enough.

 

Get yours from here!

 

Share!