WHMCS API: heritage of whmcs-ruby gem

Joshua Priddle did a great job back in DotBlock accomplishing Ruby binding for WHMCS API.  Unfortunately, last signs of activity were 3 years ago. It’s a pity, as gem is great, and works like charm, but it became massively outdated, and piled with pull requests no one merged in the master branch for ages.

The code was published by MIT license on 2011, thus whmcs-api gem will be its descendant, which I’ll try to keep updated as much as possible.

For now it’s being tested on Ruby 2.x and WHMCS 5.3.x without any problems. The source code and any issues are better be reported on the Github repo.

 

Punycode domains: why?!

why

Honestly, I couldn’t get the idea of non-latin alphabet used in domain names. Especially when the standards were passed, and Registrars started offering cyrillic, arabic domain names, but web browsers still were preferring to output it as a punycode mess.

A pretty simple cyrillic domain like ‘президент.рф’ (stands for president.rf) becomes ‘xn--d1abbgf6aiiy.xn--p1ai’. Not all the browsers still keep cyrillic domains in the address bars, so you’d see some punycode mess in there.

Ugly indeed, and not really useful, so for fast domain unicode/ascii checking that all of them are properly synced, got this tiny script:

How bad is your Change Risk Anti-Pattern index?

Measures the C.R.A.P. (Change Risk Anti-Patterns) score. It is designed to analyze and predict the amount of effort, pain, and time required to maintain an existing body of code.

A method with a CRAP score over 30 is considered CRAPpy (i.e., unacceptableoffensive, etc.).

 C.R.A.P.(m) = comp(m)^2 * (1 – cov(m)/100)^3 + comp(m)

Where comp(m) is the cyclomatic complexity of method m, and cov(m) is the test code coverage provided by automated tests.

Slack: team communication

Slack: communication tools
Slack: communication tools

This is just a perfect example of B2B communication tools. Free to 8USD/mo+ is more than enough to setup a standard communication tool in a small company (i.e. startup, or SMB) just to cut the never ending story on xmpp/skype/email/etc.

And as any geek, they got me on “integration” section:

  • GitHub
  • Asana
  • Dropbox
  • Nagios

For those who’s got a missing bit of team communication in their shipping/communication chain for product delivery. This one’s for you folks!

Friday pint talks with fellow inhouse developers

X:- Hey, we’ve recently launched a cool piece of NDA in our proprietary NDA.
Y:- Sounds great. How did you manage to prototype it?
X:- Well, we took some NDA, with NDA, cuz the first one had some problems with caching, and with some NDA, we got this NDA to work!
Y:- Why did you use this NDA, when NDA we use in the company does NDA better, it’s more NDA, NDA and NDA that this!

Open-source helps people socialize! 😉

SQL reinsert row in the same table

Seems that we have a competitor to “export to csv” sql query that I keep forgetting every time I need to export something in the CSV file.

The second nominee is reinserting the row into the same database but with a new primary key.

# YOURID - source record
# yourtable - target table;

CREATE TEMPORARY TABLE tmp_table SELECT * FROM yourtable WHERE id=YOURID; 
SELECT @new_id:=((SELECT id FROM yourtable ORDER BY id DESC LIMIT 1) + 1); 
UPDATE tmp_table SET id=@new_id WHERE id =YOURID; 
INSERT INTO yourtable SELECT * FROM tmp_table WHERE id=@new_id;

 

Basically, and obviously it’s about me

Recent post from Wynn made me cry, because I’ve realized that I haven’t been updating some of the API documentations for quiet some time!

Whether I’m working on docsguides, or books, Vim is my jam. In order to curb my use of these weasel words, I added some formatting rules to mydotfiles.

Forked, added. Doc files are sparkling with these parasite words.

500px hits commercial marketplace

On the heels of our 500px Marketplace relaunch, we are hard at work building a brand new commercial licensing marketplace based on the feedback of our 500px Community.

This new marketplace will service commercial licensors of photography from the news, editorial, advertising and various other communities who are interested in licensing work by members of the 500px community.

If you are interested in commercially licensed photography from 500px, join our mailing list to be kept updated on our progress toward launch. Member photographers on 500px are being reached on an individual basis, based on their online portfolio, to participate in our pre-launch program.

Good news for 500px. Really nice user-friendly service, with lots of great photos.  Go and check yourself 😉