I find it useful to display the current git commit ID of my application:
In your application’s Gemfile add the grit gem, which is a Ruby wrapper for git, and run Bundler.
If you deploy your web application via Capistrano and git, then you can put the following in your app/helpers/application_helper.rb:
Make sure the repo you are deploying to is non-bare. If you are not sure about that, in the project’s directory run:
If you see a SHA-1 Hash, life is good.
Now in your template you can add the helper anywhere you like – most people prefer to put that info in the footer:
How easy was that!
I had a hard time how to make JSONP response data render in a Sencha Touch 2 list view, but I made it. WOOT.
So, here’s the code:
The last line of the the index method will be clear when you understand read the query string parameters which Sencha sends to the server:
and, ultimately the Sencha Store object:
I wonder if you can write a more elegant method?
I love Evernote, and I hate it for taking notes. Seriously, the concept is great, but the editor does not fit my needs.
I am not very picky, there are just a few things about Evernote that need to be fixed:
- Documents have no semantical structure. There are no sections. Plain text is as intelligent as an Evernote note.
- Outline support. Even headlines would be acceptable.
- Table of contents. Notes get large and messy; scrolling and searching (and not finding) will be unavoidable.
- Export notes. I want to create a spreadsheet whenever I feel like doing so.
- No one needs fonts (at least I never needed them); I just want to write down notes and capture ideas.
Obviously, there are some things Evernote got right:
- Cross-device. Don’t want to take out your laptop? No prob. Just take a note from your iPhone.
- Developer API. There are some awesome 3rd party services built on top of Evernote. Lastly I have discovered Hello which keeps track of people you meet and automatically syncs to Evernote.
- Voice memos.
- Image scanning
I am feeling so dirty…
I am aware of a premium version, but it doesn’t fix any of the current issues. Awkwaaard. So, I am still waiting for a miracle, (or for a person who joins me on the next Evernote-killer project).
If you know something similar to Evernote tell me about it.
In the next post I will compare Evernote with org-mode, and talk about why it’s so much better, and should be far more popular than Evernote.
After reading this part of the the puzzle’s description:
A change is defined as replacing a single letter with another letter, adding a letter in any position, or removing a letter from any position. The total score for the wall post is the minimum number of changes necessary to make all words in the post acceptable.
I was immediately reminded of the Levenshtein algorithm I read earlier in the PHP documentation.
Ironically, I didn’t come up with a solution in PHP, but Python:
Here are some sample benchmarks:
$ time python breathalyzer.py "hello world"
0 0 real 0m0.235s user 0m0.170s sys 0m0.020s
The program processes all the words quite fast if they are found identically written in the list.
Here is the the levenshtein algorithm in action:
$ time python breathalyzer.py "hellofdsf worldtra"
3 3 real 0m1.121s user 0m1.110s sys 0m0.007s
Just above a second… passable.
I want it to actually do some work, so let’s throw the phrase found at the puzzle’s page to the program: “tihs sententcnes iss nout varrry goud”
$ time python breathalyzer.py "tihs sententcnes iss nout varrry goud"
1 2 1 1 2 1 real 0m4.092s user 0m4.013s sys 0m0.070s
4 seconds! I haven’t benchmarked other solutions, so I cannot say if my implementation is one of the faster or slower ones… so leave your comments about your solution (and also some rocking benchmarks).
I did not tend to use Dired mode often, as I was not aware about its usefulness. After digging in I found out it is really easy to use and can save you some time when managing files.
So, I shared my experience by creating this video:
You can also watch it on Vimeo: http://vimeo.com/30321079
Please, do leave your comments!
Lately I have been searching a Java web application framework to develop a Competition Manager, which you can fork here. As my fellow schoolmates only had some experience with Java it had been an indispensable requirement to use Java, and Play! (the commonly used shortcut for “Play! Framework”) really seemed to be an interesting approach.
The name, at first, made me a little skeptical about the seriousness of the project, but pretty soon I knew that the people behind Play! were exceptional professionals with goals.
I remember having tried other Java web frameworks like Struts or Spring, but I couldn’t see my own code anymore amongst dozens and dozens of XML configuration files to set up your database, and start writing your application logic. I eventually gave up on those, and gladly found that there was a Java framework written by web developers for web developers: Play!
Having a strong Django and a not-so-strong Ruby on Rails background, picking up Play! was a real charm. Play! features a built-in server which allows you to run a Play! application with just a few keystrokes after installing it.
Instead of ./manage.py runserver I just had to type play run in a terminal, and voilá, a local development server was running on port 9000.
I appreciated the excellent NetBeans integration, which allowed me to use a full-fledged IDE. The good thing about that is: it’s entirely optional.
It is just a matter of typing play netbeansify in a terminal, but those who had tendencies to other IDEs or text editors were generally well served.
Certainly the very best thing about Play! is that it is Open Source software, and straight after that the awesome community. It has a very active mailing list to which I have been subscribed for a month or so now, and the response time feels good. The people are awesome and helpful.
I don’t really want to go through all the awesome features of Play!, but you can do that yourself! Visit the website, watch the introduction video (I fell off my chair after viewing that) and start your own Play! application. Today.