Node.js on nykyinen hype, nähtävästi päteviä syitä. Vaikka useita kertoja olen suunnitellut oppia sitä, en voinut hallita sitä. Se on lähinnä siitä, että erittäin kiireinen kotona ja työssä ja pysty hallitsemaan aikaa lukea iso kirjoja / oppaita. Olen kuitenkin juuri vilkaista osaksi Node.js kun olen löytänyt kirjan nimeltä Instant Node.js Starter kirjoittanut Pedro Teixeira julkaissut Packt Publishing. Tämä on osa Packt Instant sarjassa.
Packt Instant sarjassa julkaistavat ihmisiä, jotka taistelee aikaa lukemiseen. Nämä kirjat ovat hyvin lyhyitä, nopeita ja hypätä suoraan toimintaan.
Otsikko on hieman skeptinen. Eikö olekin? Mutta luottaa minuun, se on totta. Voit toteuttaa solr tehohaun oman Ruby on Rails sovelluksen tietämättä Solr . Kyllä, olet sivuraiteelle tietää Solr. Mitä et tiedä, miten tehdä se toimii sinulle. Katsotaan tarkistaa miten voit virtalähteeksi sovelluksen Solr käyttäen Sunspot helmi.
Mikä on Sunspot?
Auringonpilkkujen on Ruby kirjasto ilmeikäs, voimakas vuorovaikutus Solr hakukone. Auringonpilkkujen on rakennettu päälle RSolr kirjasto, joka tarjoaa matalan tason rajapinta Solr vuorovaikutusta; Sunspot tarjoaa yksinkertaisen, intuitiivisen, ilmeikäs DSL tukema tehokkaita ominaisuuksia indeksointi esineitä ja etsimällä niitä.
Käyttämällä auringonpilkkujen DSL, voit helposti toteuttaa solr powered etsimistä. Sen drop-in tuki Rails mallit voit valtaa sivuston kanssa muutaman rivin koodeja.
I’m big fan of TV commercials in indian televisions those try to promote patriotism. They nicely talks about their country and to love her even when advertising their products.
Though many of the TV programs (like Reality Shows, family breaking serials) ideas are borrowed from indian televisions, I was always thinking why we don’t see such patriotism in our ads? Why our commercials do not talk to love our country, to use our local products! I think my days of frustration are over. Recently I’ve seen two tv commercials that are talking about the love for the country and make some change. I’ve embedded those two in this post.
Robi (Mobile operator) TV Commercial:
Frutika (mango juice) TV Commercial
These two are ads I watch in full each time they are broadcasted. Each time I see them I see like I’m seeing it for the first time.
If these ads can change a single person, or at least make him to think different; that’s a big success. I wish to more like these in coming days.
Deploying with heroku is as easy as just pushing your master branch. However, this does not work for me as I manage different branch for development and staging. If I push these branches to heroku (different instance), it won’t work. It is because Heroku considers only master branch for deployment.
The work-around is very easy with the power of git. All you need to push your WHAT-EVER local branch to master on git. Please make sure you’re not doing this to your production instance.
I’ve created another instance that I will use solely for development test. My local development branch of git is named ‘develop’. So this is what I need to run
git push heroku-dev develop:master
Here, heroku-dev is the name of my git remote server for testing. I’m pushing my local develop branch to remote’s master branch. Now, heroku will respect your wish .
Today, while digging routing guides of Ruby on Rails, I spot this new feature which is available in Ruby on Rails 4. Routing Concern is a wonderful concept of re-using routing definitions. I just love how Rails try to reckon on DRY principle. I’ve worked in a project where routes.rb has about 50 lines of definition while the project was progress not more than 20%. There were many similar routing definitions in different scopes (namespaces). Routing Concerns will now enable us write less codes to define application routes.
I’m now going to show how to use it as Rails guide already did the job. I’m simply copying the codes over here.
I’ve also found this blog shared on facebook by one of my friend
When you run Rails app using Phusion Passenger (modrails), by default, it runs in ‘production’ mode. However, if you want to run it in ‘development’ mode for any reason, you need to add a directive in your apache/nginx configuration.
It is because I need to install taglib before I install taglib-ruby gem. However, this was not as easy as I thought it would be. In CentOS I could not compile the version 1.8. After trying different things, I tried and could compile it’s 1.7 version.
In an application we are using Handlebars templating. However, we needed many custom helpers to do what we wanted to achieve. Here are some of those helpers. It may help someone who is looking for achieving similar things. Examples are included.
Character limit with trailing characters (optional).
Recently, I’ve worked with Tastypie which is my first introduction to tastypie. Tastypie itself is wonderful and very easy to work. However, my first catch was that I’ve to use it in a scenario where data source is not django’s ORM. My goal is to expose some API endpoints but the data will come from some other external API. Confusing? Let’s discuss about the implementation not about the wisdom of use cases. If you do not have introduction to the Tastypie, please have a look at their documentation .
Generally, when we create a Tastypie resource, our class inherits ModelResource. ModelResource is actually provides django’s ORM specific accesses as the resource is created on top of Django models. The fact is that, ModelResource is a thin wrapper on top of it’s Resource class and overrides few methods. If we want to use our custom data sources, we will have to override some methods of this Resource class based on our requirements. The methods we have to override are:
I received the paperback of KnockoutJS Starter book on 28th December, 2012 though I’ve already completed many pages reading its PDF version. I could not publish my review as I was little busy with our Ruby Conference in Bangladesh .
KnockoutJS Starter is written by Eric M. Barnard and is published by Packt Publishing. This is a very short book which can be completed reading within a week or two.