SteamCube is a SCAM

So, if you watch Twitter for even a short amount of time, you will inevitably see a ton of affiliate links steam-cube.com. The premise on the page is you get 15 people to click your link and then you complete two surveys, and you get a free $20 Steam Gift Card. Sounds great right? Wrong.

So I went through the motions with a throwaway email account and eventually the first survey said completed, but the second survey would never finish.

steamcube1

Being a web developer, I got curious. I dug into the code. Check out this gem I found hidden inside an iFrame:

steamcube2

In case Javascript isn’t your cup of tea, let me break down what is happening here. When you click the first survey button, it opens up the spam ads (ahem, I mean survey), sets the button text to “Uncompleted…” and then sets a timer for 1000*60*5 milliseconds, or basically 5 minutes. When that time has elapsed, a callback is called and the survey is set to “Completed…”.

You didn’t actually “complete” the survey. I used to work in an industry similar to this and true affiliate marketing uses tracking mechanisms like cookies and “pixels” to track a referral and then ping back notifications of completion. This isn’t happening here, it is all a ruse.

In the second one, you will see that it opens your spam ads and then just sets it to say “Uncompleted…”. They basically get you to go click on a bunch of ads, make them money, and then sit there until you get frustrated and give up.

Good thing they tricked you into getting 15 of your friends to do it too huh?

Stay away from Steam-Cube.com, it is a complete SCAM.

Vagrant + Windows 10 Fix

Have you run into something like this and are tearing out your hair trying to get past it?

After more time than I would like to admin, I found the fix. The first step is to download the file found here, created by Jiri Hruska (known to the Internet as Yirkha).

You have to run it as an Administrator, and it will pop up this box:

virtual-box-win10-fix

 

 

 

 

 

 

Then you need to find VirtualBox in Windows Explorer and set VBoxManage.exe  and VBoxHeadless.exe to run in Windows 7 Compatibility Mode. To do this, you right click on the file, go to Properties, then Compatibility, and use the box for setting it.

On my system, those files are located in C:\Program Files\Oracle\VirtualBox

Now when you run vagrant up, it should get past the network adapter error because that little tool increases the timeout values for you.

If you want to see the full context of how this fix came to be and read more, take a look at VirtualBox Ticket #14040.

Laravel Elixir Remove CSS Comments

Have you ever wanted to strip those block comments out of your production CSS? In the past, I’ve run into issues where the CSS is not processed correctly because everything gets bumped onto the same line as Bootstrap’s block comment and it somehow things it is also commented out. No worries though if you are using Laravel Elixir (or really just the cssnano plugin):

Here is an example of how you can configure cssnano to strip all comments:

If you are just using cssnano in a non-elixir build, you can still pass the discardComments: { removeAll: true }  option to achieve the same effect.

Javascript Wait Until jQuery Loads

Ok, if you are like me, you’ve probably had the need to put a small snippet of Javascript between some <script> tags in a view. But, if the rest of your javascript is loaded somewhere in the footer of your layout, then at the point you run that embedded snippet, none of your other libraries will have been loaded.

Allow me to introduce you to a little technique that can be an interesting workaround. I can’t claim to have found this trick as I ran across it on an awesome StackOverflow answer.

Allow me to explain what is going on here.  You will notice the function is wrapped with parenthesis followed by another set of parenthesis. This is called an immediately invoked function expression (IIFE), which is a fancy way of saying that it will run automatically when the code is loaded. When it runs, it checks to see if the window.jQuery object exists and if not, it sets a timeout for 50ms and tries again. This will continuously loop until it detects that the jQuery object exists in the global namespace and will then run your code.

This doesn’t only apply to jQuery. For my use case, I had a javascript object that I needed to set a counter based on values loaded in from a form with dynamic sections. This is  how I made that work:

You will notice the {{ … }} syntax in there. That is the blade templating language in Laravel. For my use case, I needed to generate 0 to N instances of a template and keep track in javascript how many I had so that the next instance generated client side had the appropriate numbers applied to input field names. Probably not the best way to do things, but definitely functional.

 

GoLang, Qt, and Robert Frost

One of my most favorite poems is The Road Not Taken by Robert Frost. Something I was working on tonight sparked my memory of a line from that poem.

Yet knowing how way leads on to way,
I doubted if I should ever come back.

It all started with my decision to start dabbling with Go, a newish language created by the folks at Google. I’m exploring it because it is lightening fast and can be a great solution for some of the intensive data manipulation stuff I am working on, where PHP really struggles to perform. As someone who spends a lot of time in scripting languages, I had to remember the old days when I used to dabble with C/C++ and get back to understanding compilation. Lucky for us, Go handles memory management for the most part, which really makes it much more enjoyable to code with!

Although I love my trusty Sublime Text 3, I felt compelled to find an IDE that would help out more with syntax completion and make it more difficult for me to make stupid mistakes. Alas, I came across an open source project called LiteIDE. Sweet! So I installed it on my Macbook without a hitch and started using it. As I started perusing the options and settings, I couldn’t help but notice there were some misspellings and incorrect grammar. This isn’t a big deal — I am acutely where that I do not live in an English speaking bubble and some of the best developers come from all around the world. So, I thought, hey why not give back and send them a PR with a few updates? I cloned the project and made some changes. Although they are just translation changes, I figured I should try to build the project and make sure I didn’t break anything.

Looking through the code, I find a build folder with a convenient bash script setup to build on OSX. Give it a go and quickly find out I need Qt. Ok, although I’ve heard of it, I’ve never used it. So, off I go to download it and install it. After some path configuration so it can find qmake, I try the build again — no dice. Lots of errors like unknown type nume QIODevice and things about not matching a ColorStyleScheme declaration. Oy! I’m way out of my element here.

I will probably still submit the PR since it is only translation changes, but the point of the post is something I often find myself doing when experimenting or learning new things. There is so much to learn and when I venture down an unfamiliar road, I often drift from subject to subject learning just enough to contribute to the original goal. I’ve found this experience to a rewarding way to learn and has attributed to my achievements as a developer. I guess, like Robert Frost, you could say I took the road less traveled, and that has made all the difference.