PS:350 – The week that didn’t stop!

Oi! This was one of those weeks that while I’m excited about extra hours for consulting, I’d just as soon be done and sleeping!

I have 3 more tasks on the docket this evening, finishing a quote, a server, a piece of software.

Honestly? At the rate I’m going I think I’ll get 2 out of 3 unless I get a large boost in what I’ve got coded already. It’s glitchy, to begin with since I’m working with a really hard to work with the codebase. For instance, I’m having to embed javascript into javascript, to produce something that would have been easier and made the site function better if they simply avoided javascript in the first place.

I’m all for progressive coding ideas to give a real-time experience, no refreshing, however, honestly? for what this site does it should have been flat PHP generating HTML no buzz, no fluff, just HTML.

Now, this week will eventually end, but hopefully, I can get some rest before a busy week ahead.

PS:334 – Small Coding Project

While I’ve wrapped up a few things on the docket (foof) I took a little time tonight to write a small tweak for a project of my own related to crypto currency.

I replicated a Google Spreadsheet (link) from BiteSize Bitcoin (link) and while it was designed around my Litecoin investment, you can just as easily adapt it to handle Bitcoin or any other alt-coin you like, it simply helps log your transactions.

Now I have a much more complex version rolling now which is a single sheet for all my assets across alt-coins etc. and it contains things like the type of transaction (purchase, trade, mining) as well as some general profit statements across the board.

Now the one thing I wanted to have was a live updated current coin cost, and I used an importXML function someone posted on a video, however, it was slow & tended to time out with “too large” of a dataset to crunch so I wrote this small PHP app:

<?php
$url = file_get_contents("https://min-api.cryptocompare.com/data/price?fsym=".$_REQUEST['coin']."&tsyms=".$_REQUEST['curr']."");
$json = json_decode($url,true);
print $json[$_REQUEST['curr']];
?>

And that’s it. 3 lines to get exactly what I need, and I simply use the Google Sheets command: =IMPORTDATA(“http://domain.xxx/coins.php?coin=BTC&curr=USD”) – That’s it. With that in place and the coins.php made, when I load my sheet to record or review where I’m at – math is all done for me based upon the current rates in my currency! See the example? It’s a break down to BTC in USD currency, so the current USD for Bitcoin. Easy peasy.

Must say all and all, very happy with the code, of course back to the real world, as if I can wrap a few projects this week, I’ll survive back to school! (oi!)

PS:308 – Coding Day

So today is a coding day, trying to clear my head and dig in, I’ve mapped out 99% of this, working on streamlining functions for this and basically re-inventing how an existing app works to help keep the lights running. Oi.

I’ve got myself notes on the current database, file structure, and going to tie that all into a magical little script which works to build a backup of data which the current system has no backup option at all, going to make it on-demand too for the customer + tune up some old code aside from this new number.

Low on sleep, but writing strangely helps clear my brain, even if I’m not skilled at making sure the correct form of “your” is in there 😉 I do what helps and this helps focus and clear my head, so now, onto the fresh dev box I just built out to get coding. Happy Tuesday All!