Ryan Detzel

How All Disputes Should Be Settled.

Quick 3 challenge

Code Sharing Dilemma.

Should I share code when I know it’s not going to add any value to the Internet and only clutter it with more useless spam content?

An old colleague contacted me recently congratulating me on my cool script I wrote. We wont get into the details of the script but it was a bot that performed a certain task and since this person is following me he was able to spot it. Since I’ve worked with him in the past and he mentioned he’s been trying to do something similar I offered up the code. I thought he was going to use it for his job, maybe they were trying to do something similar to what we’re doing so there is no harm in that. After I sent off the code he messaged me back thanking me and telling me his true intentions. He planned on using the script to basically spam the Internet with useless pages filled with ads. Ugh. Maybe I should’ve asked him what he was going to use it for first; maybe I shouldn’t care but either way I couldn’t help but feel responsible for cluttering up the Internet with more useless content. I wish him luck on his ventures but going forward I’m probably going to be more reluctant to share clever code so I can avoid such moral dilemmas in the future.

Changing Over to Amazon RDS

We moved our dedicated mysql server over to RDS a couple of months ago and I would suggest to anyone that can justify a dedicated sql box to do so too.

Pros

  • Reboots quickly and easily
  • No software updates, no security patches to deal with
  • Start/stop additional resources quickly and easily.
  • Hot standby is really easy to setup
  • Read replica’s are super easy to setup too
  • Hot snapshots beat mysqldumps
  • Price. It’s nice to start and stop instances when you need more

Cons

  • You loose a lot of control so if something goes wrong you feel helpless.
  • Along the same lines it’s a shared box which puts you in the dark
  • You have to use a round-about system to changed mysql parameters.(turning on the slow query log for example)
  • Price. You’re paying more than an ec2 instance and you can only use it as a database server

Google Optimizer’s Strange Noscript Tag.

If you’ve ever installed Google Optimizer code you’ll notice they ask you to do something like this:

1
2
3
4
5
<script>
    utmx_func('name');
</script>
This is my default version
</noscript> 

This breaks validation(do people still care about that?) and it looks odd but they are doing something pretty clever here. A quick stop over at jsbeautifier.org let me peek into their code to discover how this works. Basically since there is no beginning noscript tag the default text will always show even if the JS above it breaks which is a must in case something goes wrong(Google shouldn’t break your site). So how does the different version of the code get shown? Simple, when the function runs it prints the new content to the page along with the opening noscript tag which in turn hides the default text. The new content ends up looking like:

1
2
3
4
5
6
7
<script>
    utmx_func('name');
</script>
This is my new text I want shown.
<noscript>
    This is my default version
</noscript> 
Back To Top