Recently I’m trying to upgrade one big project from Ruby 1.8.7 to 1.9.3.
It is bumpy road but here are some thoughts gathered during this time:
1. Make small steps – especially when pushing those changes to production. You’ll never know what are going to break.
2. When changing API endpoint find every call to that endpoint. Record HTTP requests & responses and test them.
3. Improve test coverage. The more good specs you have, the better.
4. Update only necessary gems to get your code working on Ruby 1.9.3.
5. Set up Continuous Integration server to run specs on both Ruby versions: 1.8.7 & 1.9.3.
6. Analyze & understand business logic in code. Use metric_fu, simplecov to know more about code.
7. Delete unused code.
On my OS X 10.8.5 I tried to do specific task: I want to set up FTP server where user has full access to that specific place — he can upload/download and remove files without any problems. After spending some time with this I came to solution to create new user in system and set configuration of
/etc/ftpd.conf to sth like that:
chroot REAL /path/to/directory
To start & stop FTP server I used those commands
sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist
Good reference book
In my current project I use JSON heavily as representation when „talking to” servers. I decided to read that book and possibly get some insights how design better APIs.
First three chapters are reminder how HTTP works, its semantics a protocol and what exactly REST stands for. As an example authors use simple microblog service. Consecutive chapters cover hypermedia, the collection pattern, the design procedure and much more.
From my perspective the most interesting part (& most useful) were chapter devoted to the collection pattern and discussion about minimising semantic gap. From my developer’s point of view: using consistent, well-defined structure for JSON responses can simplify parsing and it’s easier to manage.
What I miss in this book are more complex „real-life” examples. I like academic discussions but I like practical examples more 🙂
Product page: http://shop.oreilly.com/product/0636920028468.do
Cook your iOS apps
I like cookbooks and iOS6 Programming Cookbook is no exception. Author covers a lot of practical knowledge: basics of Objective-C, UI solutions, Xcode features (e.g. Interface Builder, Storyboards), concurrency, gestures, maps, networking, graphics, motion and many more.
Vandad presents material clearly, solutions contains screenshots, schemes, references and code to understand and implement it.
iOS6 Programming Cookbook is good reference book and I can recommend it to every iOS developer/hobbyist.
Product page: http://shop.oreilly.com/product/0636920027683.do
Perl from the ground up
Learning Perl Video is almost 11 hours long lectures covering Perl from the ground up. Randal Schwartz presents concepts and quirks in Perl step by step. Videos are nicely divided by topics. Every video is shorter than 1 hours, so it’s optimal to pay attention to presented material and take break between videos.
Randal presents material clearly, tells some anecdotes but there are not too many examples. Hands-on experience seems to me vital when learning programming language and I checked many code snippets when I watched those lectures.
Product page: http://shop.oreilly.com/product/0636920014430.do
Scala in examples
Scala Cookbook is very practical book. Author presents every small example as problem to solve and possible solutions with discussion. I learned syntax for some concepts (like pattern matching, auxiliary constructors, executing external commands, lazy collections) I’ve seen in other programming languages. The book helped me better understand how implicits work.
Moreover, there are available bonus chapters providing recipes about XML, XPath, testing, debugging and Play framework.
Scala Cookbook is comprehensive book. It provides practical solution for typical developer’s problem and I recommend this book everybody interested in Scala.
Product page: http://shop.oreilly.com/product/0636920026914.do
When I first saw title of this book it seemed to be quite promising, but…
After studying 5 years Computer Science there are not too many surprising topics in that book. It was nice adventure to refresh some Python and go through „Case Study” chapters.
For me, topics are interesting, but many examples are presented in too boring form and they don’t have too much interesting context.
It would be better if code were gathered in one archive/repository and author provided script to install all dependencies at once.
Product page: http://shop.oreilly.com/product/0636920022480.do
W trakcie pracy z gitem natrafiam na różne problemy – szczególnie wtedy, gdy zaczynam coś psuć 😉
Poniżej lista rozwiązań znalezionych w sieci, które przydają mi się w pracy z gitem:
- How do I clone all remote branches with Git?
- Update a Github Fork from the Original Repo
- Git: Move recent commit to a new branch
- Git: How to move existing work to new branch?
- cleaning up untracked files
- Undoing in Git – Reset, Checkout and Revert
- recovering a deleted branch using git reflog
- How do I delete a Git branch both locally and in Github?
Web is changing: new technologies, frameworks but also new devices for browsing Internet.
Big advantage of The Modern Web book is that at the end of chapter there is further reading section. Author provided source code of examples on: http://modernwebbook.com.
Product page: http://shop.oreilly.com/product/9781593274870.do
I’ve written many web apps in many framework and languages (Sinatra, Rails ⇾ Ruby; Snap ⇾ Haskell; Play! ⇾ Scala; Mochiweb ⇾ Erlang). However, Lift was not-so-easy to grasp for me.
Lift Cookbook is very practical book. Author covers the most basic & used aspects of web apps (HTML rendering, form, Ajax, REST API, connecting to SQL & NoSQL databases and more). Material is presented in question-answer (+discussion) form. Author provided set of repositories on Github as working examples.
Book is well written. Examples work. That’s how good cookbooks should look like.
Product page: http://shop.oreilly.com/product/0636920029151.do