Saving the world one blog entry at a time

I started making websites in 1998. Gosh, in the internet years, that’s a forever ago. Remember Perl CGI and its cgi-bin folders? I have also written a lot of website using php along the way, and LAMP stack was sort of my thing for a while. But since I started to focus every efforts on front-end stuff, it have been a while since I looked at simple backends. Some of the sites that I created long ago desparaetly needs some updates. I have, in the past, thought or looked into converting sites to ruby on rails at one point, then looked into python, then thought hard about switching to some kind of static site generator engines (like jekyll or assemble.io), and finally more recently, thought about converting them to MEAN stack. But, really, who has time for that? Lately, I am thinking about just upping my php level and “patcing” it right in php5. Or at least keep the database structure and convert the backends to be more like API or services, still using php.

This weekend, I have been sort of playing with one of my old project: Softball Stats, written by David Carlo. It is an awesome little project.

“SoftballStats is a collection of PHP4 scripts and a MySQL database that track the stats, games, players, and every play made in multiple softball/baseball seasons. SoftballStats also compiles statistics for each player.”

I could use this on my work co-ed softball team, or also use it for my son’s summer league. I started updating it on my github.

I am learning tons this week. Very exciting. Working with smart people of Bocoup, learning/picking up tricks and tips on how to do many little “a-ha, that’s how you do it” things.

Here is my notes:

With Editor Config, you can create a project specific configfiles for your text editor of your choice. I am using sublime, and there is a package for that. Now we have a file on the project home that specify that we use tab for indentation for our project — that’s our style that we agreed on, and we are keeping it consistent — but I can start using two spaces for my other projects with this.

Bower is powerful. It’s managed by Twitter. Their stock is now at $40. Time to buy?

This gist by Matt Surabian is awesome. If you put it in your .bash_profile, your terminal shows your branch and with a * star if there is a change that needs commits. I use terminal with white backgroudn so I change like 38 to

At my work on my team, we have five main developers. Two of us are on Mac, while the other three are on Windows. I, as a front end guy in the group, am advocating for SASS/Compass be used prominently on the redesign, like in depth use (great book btw). There is one little problem — workflow. To be able to developed locally, SCSS require pre-compiling, and it uses ruby. Mac comes with ruby, but Windows does not. Grunt could do it, but then you need node.js/npm. If I want everyone on my team to have it, I need to install all of those (ruby/sass/compass/node/npm/grunt)… that would be just way too much customization/potential places to break.

Dealing with Vagrant really tickled my inner linux nerd-ness. Once upon a time, I was involved with running a group called BJLUG, Boston Japanese Linux Users Group — this was way back when, when you still had to pay for Apple’s CJK Language Pack to have Japanese installed on your machine, and I figured out that if you use linux, it was FREE to write email back to Japan etc. There were certainly a lot of LUGs back then. Not sure if they are around any more.

I learned how to install puppets, thanks to my colleague Kevin D. who patiently walked me through it, and was able to create box with apache and the likes.

Now we all need to download, and then just run vagrant up and vagrant provision. And your local scss changes, on your filesystem, using your favorite text editor on your OS, will be watched and css is compiled without any additional work. This is beautiful.

vagrant suspend and vagrat resume – If you don’t want fully shut the VM down

vagrant halt – Stops the VM

vagrant destroy – Deletes the VM

Actually, first time I saw use of vagrant was WordPress VIP team’s quick start. It includes all their server hosting environment. They do good work there over at VIP. And also there are ways to have local WordPress environment in vagrant such as Varying Vagrant Vagrants (VVV) environment. I am still using MAMP for my local wordpress theme/plugin development (when I have “free time”) but perhaps I should reconsider it. For new version of Daigo.org theme?Continue reading…

Noticed couple of things that I am doing over and over, and everytime I am doing it, i had to look it up (Thank you, Google for making us dumber and dumber…) thought to put it in a place for my future self…

While I thought it was great idea, I was not super crazy about HAML. Thanks to css and jquery, I always think DOM in css selectors. However, I just couldn’t stick with HAML. I liked to be able to code in html with < and >.

Amazing. $ for number, * to multiply, and lorem to put lorem ipsum in there. Awesome.

To install emmet on my sublime text 2, I have already had Package Manager installed on it, so all I had to do was run Package Control, which you could do by Menu > Tools > Command Pallete. Or hit Cmd+Shift+p. Type in install, select “Install Package.” Find Emmet, select. Done.

But what really sold me on Emmet was the “action” for comments. You can comment things with Command-/. Which works with both html and css (didn’t try with js, yet).

In css, m is margin, p is padding, bd for border, bg for background, etc. Great cheat sheet here.

Open a new file, save it as index.html, type ! and hit tab. Boom. HTML5 document is created. Crazy. I love it. Thanks Emmet!

Package management is great. Yes, it is… WHEN IT WORKS. At least that was my attitude before.

As I anticipate release of Zurb Foundation 5 on November 21st, I couldn’t wait for it to go live. So, I decided to peak into their github branches. They are using Grunt in their process, and Foundation will be included in bower. And documentation is built with Grunt using assemble.io. OK, those things are things that I have not have time to play with. I hear all the good things that node.js and its npm installed application can do… a lot of it like magic, they say. I just have never done it, partly because I was using Red Hat’s rpm when it went from Red Hat to Fedora and it stop working, and more recently, something went wrong with ruby version control RVM thing.

I am still a designer-turned-himself-into-developer, and even with all of my geekiness, still don’t quite understand, or still have a fear, about “computer science”.

Anyway. I decided that the time is now. Just do it.

So, here are my notes while I struggled through it all. I will likely have to do it again when I get a new computer or anything like that. I figured it would be good to leave trace.

(Note: If you are here for “npm: command not found” problem, skip the middle part when I struggle with it and go to the end of the post for solution. It’s a permission issue and you need to run this: sudo chown -R $USER /usr/local)Continue reading…

Reverie is awesome. But since the theme is not installed through WordPress’s eco system, it doesn’t automatically get updated like some other themes. I noticed that the theme had update. I haev forked the theme to my repo, and wanted sync the changes.

Happend to me a couple times, and it is easy to fix but I always have to struggle, so leaving myself a note as well as parhaps helping people.

Good people at Dreamhost has made bunch of useful tools available, and one of the tool that I really like is the Cron Job, a simple UI that helps you write
Good people at Dreamhost has made bunch of useful tools available, and one of the tool that I really like is the Cron Jobs, a simple UI that helps you write otherwise pretty complex crontab. I am a big proponent of “automate boring things when possible, and spend time doing something that counts.”

For example, I have ste up a bunch of scheduled php scripts, mostly maintenance stuff. One day I got this error, and my php script was not excecuted:

After some investigation and help from Dreamhost support, I found that this is caused by a tempoprarly lock file, which prevents parallel executions, was not removed after the excecution of the script for what ever reason. Fortunately, the owner of file is me, so I can delete it myself from command line.

Here is how:

cronlock files are in /tmp folder, so ssh in, and cd /tmp

Try listing cronlocks by typing ls -al cronlock*

Find your username in that list, and notice that your locks (if there are multiple) all have common 6-digit numbers trailing cronlock, such as cronlock.1234456.78901

As a front-end developer, I want a easy way to put logos of MLB teams to the website/visualization so that I can easily enhance visuals on my database driven site/data visualization without much fuss

There are bunch of sabermetrics sites out there that offer bunch of really interesting contents. My hope is by creating this and open sourcing it, those sites can easily enhance their visuals as exciting as its contents.

I’m pretty happy with the outcome. I pulled off what I wanted to accomplish in a time that was available. I did do a little bit of illustartor prep, (organizing logos into adobe illustrator format) but I did all the .ai to font conversion (using Glyphs Mini), css coding, writing and building a how-to documentation (github page using jekyll/foundation. Responsive, of course.) and building examples/demo within the hackathon time, beating the deadline!

As part of a demo, I used the Sports Data LLC’s API. It is really good. You can get an API key as trial and pretty much on the spot start using this. I think it is useful for baseballhackday in spring. I used Game Boxscore API to call in the day’s game, and deopending on the number of runs, changed the font-size of the logo. This was done in less than 2 hours (I had to skip *free* lunch, boo hoo) and I still need to work on it so that it’ll get more days than just that one (though I would be happy to imortalize the 13-9 win over Yanks.)

Creating font icon was something that I wanted to do for a while, but didn’t have time to execute. Now that I know how to do it, I feel can do this for my work going forward. What is nice is that all of those logos are in there and you can make them as large as you want, display resolution independent, retina ready, and it is only ~24k.

I used the mini version which is only $44 and only support upper/lower case alphabets plus space (53 total) but the pro version is $300. If you are using it, I think it is money well spent imho.

***

I been tweeting nonsense since May 19, 2007 (such long time ago, can you believe that?). I put weekly digests of my tweets on this blog, so that I can search for it quicker using my blogâ€™s search function. I tweet awfully a lot about baseball (I am a Red Sox fan, if you didnâ€™t notice), but if you are interested, please follow me at @DaigoFuji. Here are my tweets between Sep 1 and Sep 7: Continue reading…