لحظة Node.js كاتب مراجعة



لحظة Node.js كاتب

Node.js هو الضجيج الحالية، من الواضح مع أسباب وجيهة. على الرغم من عدة مرات لقد خططت لمعرفة ذلك، لم أتمكن من التعامل معه. انها في معظمها لكونه مشغولا للغاية في المنزل والعمل وغير قادر على إدارة الوقت لقراءة الكتب / كتيبات كبيرة. ومع ذلك، كان لي مجرد نظرة سريعة إلى Node.js عندما كنت قد وجدت كتابا بعنوان Node.js الفوري كاتب تأليف بيدرو تيكسيرا الذي نشرته دار النشر Packt. هذا هو جزء من سلسلة Packt لحظة.

وتنشر سلسلة Packt للالفوري للأشخاص الذي يكافح مع الوقت للقراءة. هذه الكتب هي قصيرة جدا وسريعة والقفز مباشرة في العمل.

مواصلة القراءة

البقع الشمسية - الطاقة يصل التطبيق الخاص بك مع المؤسسة العامة قبل أن يعرفوا ذلك

هذا الدخول هو جزء 2 من 2 في سلسلة روبي الأحجار الكريمة


هذا العنوان هو متشككا قليلا. أليس كذلك؟ ولكن ثق بي، هذا صحيح. يمكنك تطبيق قوة المؤسسة العامة تبحث في روبي الخاص بك على تطبيق القضبان دون معرفة المؤسسة العامة . نعم، كنت خرجت عن مسارها تعرف عن المؤسسة العامة. ما لا نعرفه هو كيفية جعلها تعمل من أجلك. دعونا تحقق كيف يمكن لك قوة التطبيق الخاص بك مع المؤسسة العامة باستخدام البقع الشمسية جوهرة.

ما هي البقع الشمسية؟

البقع الشمسية هي مكتبة روبي لمعبرة، تفاعل قوي مع محرك البحث المؤسسة العامة. بنيت البقع الشمسية على الجزء العلوي من مكتبة RSolr، الذي يوفر واجهة ذات المستوى المنخفض للتفاعل المؤسسة العامة؛ البقع الشمسية يوفر بسيطة وبديهية، DSL معبرة تدعمها ميزات قوية لكائنات الفهرسة والبحث عنهم.

البقع الشمسية باستخدام DSL، يمكنك بسهولة تنفيذ البحث بالطاقة المؤسسة العامة. انخفاض لها في دعم القضبان مع نماذج تمكنك من السلطة موقعك مع بضعة أسطر من الرموز.

تركيب

أضف السطر التالي في ملف حزمة الخاص بك.

gem 'sunspot_rails'
gem 'sunspot_solr'

Then run ‘bundle install’.  Continue reading

Patriotism in TV Commercials

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.

Development/Staging server on Heroku

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 :) .

Rails 4 “Routing Concerns”

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.

Update:

I’ve also found this blog shared on facebook by one of my friend

Passenger – Run Rails app in development mode

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.

Apache :

RailsEnv development

Continue reading

Handlebars helpers

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.

Adding/Subtracting

Character limit with trailing characters (optional).

Using Non-ORM data sources with Tastypie in Django

Source: http://www.inquisitr.com/183142/state-department-to-reject-keystone-xl-pipeline-reroute/

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:

Continue reading

KnockoutJS Starter

KnockoutJS Starter

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.

Continue reading