Categories
Gaming PC Nerding

Over tinkered voice chat for my 3DS

Almost one month ago Monster Hunter 4 came out, delivering the killing blow to my dying social life. Now, being the asshole I am, I have almost no friends and none of those have a 3DS to play videogames with me. But here comes the Internet, where you don’t need many friends to be happy and, thanks to a forum, I got some people to hunt with me on MH4. The problem is: 3DS has no voicechat and I love voicechatting with other players. We got around this limitation using a VPS and installing a Mumble server, but you need another device for using it, like a PC or a smartphone. And then you can’t use headphones on both your pc and 3DS, fuck it.
Easy solution? Use a stereo mixer or something like that, but I didn’t want to waste 25€, I had to improvise using what I had readily available.
So my solution was using an USB audio card, an Asus Xonar U3 that was lying around since the laptop it was connected to broke, plug both microphone and headphones in that card and use my PC’s line-in (set to loop) to get audio from the 3DS.

mh4_voicechat

This setup has the added benefit of listening to music in my headphone while playing.
The only downside was that in this case “size matters”: the only 3,5mm audio cable I had for 3DS-PC connection is extremely short and I have to keep my hands on the desk. I tried switching mic and 3DS output ports but for some reason the mic stopped working if plugged to my PC’s line-in and 3DS to USB audio had a noticeable hissing.
It might be a bit overkill for this use but hey, I was able to make it for free and if it’s stupid and it works, it’s not stupid at all!

Categories
PC Nerding

The cheapest JS URL shortener ever

After my previous article about shortening urls using htaccess, today I’m posting a little JS snippet that will allow to shorten urls, using a JSON array to store shorter and longer urls. The script will look in url parameters for a short url and redirect to the associated longer url. Have a look:

<!-- // Function declaration
function shorturl_redirect() {
	// This JSON array contains all the shorturl/url pairs
	var urls =[	{ "shorturl":"?lndm" , "redirect":"http://www.lanoiadimuu.it" },
			{ "shorturl":"?example" , "redirect":"http://www.example.com" },
			{ "shorturl":"?twitter" , "redirect":"http://twitter.com/lanoiadimuu" },
	// Get the url parameter
	var shorturl = location.search;
	// If there's no url parameter stop script execution
	if(!shorturl || 0 === shorturl.length) { return; }
	// Now the function will look though urls array and if a valid shorturl is found it will redirect the browser to the longer url
	for(i = 0; i < urls.length; i++) {
		if(shorturl == urls[i].shorturl) {
			window.location.replace(urls[i].redirect)
			break;
		}
	 }
}
// Function call
shorturl_redirect();
// -->

Now for an example, if you point your links to www.yourexample.com/?lndm or www.yourexample.com/index.html?lndm the script redirect your browser to this site homepage.

Some quick notes:
- It will work on any hosting/subdirectory/webpage/cms/browser combination, unless the visitor is actively blocking JavaScript (eg. NoScript plugin on Firefox). All php cms still need to be fully loaded by the hosting environment before serving the script.
- I suggest placing this snippet (or .js file) between head tags, ideally you want the browser to stop loading html and go to the provided link.
- You can wrap the code into a JS anonymous function, since the code needs to be executed only once.
- The script is really small in size: the above example is only 834 bytes including comments. Byte size will vary according to your array size and url lenghts, for example I made an array with 50 entries and it was 5,3kb.
- It does not require additional libraries, eg. jQuery, or additional url shortening services, eg. Bit.ly or Yourls.
- Depending on the behavior you may want, you could change window.location.replace with window.location.href . For more information read here.

Categories
PC Nerding

Reading white text on black background

This will be a quick post.
If you, like me, really can’t read white text on black background (or can’t read purple on slighty darker glittering purple. Yes, I’m talking to you, MySpace nostalgic!) I have a quick solution for you: don’t and avoid headaches . If a site has a crap color setting, you probably can find the same copy-pasted content on other sites. If can’t find the same content on properly colored sites, use the awesome Web Developer Toolbar, available for both Firefox and Chrome (Opera too, in case your are looking for other NON-IE alternatives 🙂 ).

Once this plugin is installed and activated a new toolbar will appear. From there open the Disable menu and activate the Disable Page Colors option. Et voilà! Everything will transform into a bland black text on white background. Don’t let a bad developer decision turn you down on content!