Active Admin - customize default CSV export

ActiveAdmin is great framework for managing website administration interfaces. It allows us to list records of a table, filter them, sort them and also support exporting them in CSV, XML or JSON. By default, records that are being displayed are exported. For example, say we have a products table where each product is distinguished by their type. We can apply a filter to list all electronics products. Clicking on CSV link below the list will export all electronics products only. But sometimes we need to download specific records coming from a custom query or scope using the default csv link.

JQuery .closest() and .find() Selectors

The .closest() and .find() are very handy methods in JQuery. These 2 selectors are useful when you want to find corresponding elements where the event has triggered. .closest(): This selector traverses up the DOM till it finds the matching element for the supplied selector. .find(): This element traverses down the DOM along descendants of supplied DOM element. Let's take a look at one example of how to use these 2 selectors together. <form action="/posts/456/attachments"> <strong>Upload file:</strong> <br> <input type="file" name="

3D touch Quick Actions in iOS Swift Language

In iPhone, A user can now press Home screen icon to immediately access 3D touch Quick Actions functionality provided by your app. By Pressing hard on the home screen icon can now launch a quick action menu to take the user directly to parts of the app. Users with devices that support 3D Touch will use this feature. You can add this feature quickly. Home Screen Quick Actions Quick actions can be static or dynamic. You can define static actions at build time and dynamic actions at runtime. Static actions are visible to the user when they install or update

Ember Inspector and Ember debugging

As software developer most important thing for us is to understand debugging. When things go wrong with code, we need to be able to find the bug quickly and solve it. Today we are going to have look at some important thing regarding ember app debugging. These are small things but can help you if you are new with ember and trying to debug some error in your ember application. Ember Inspector: It is a browser extension available for Chrome and Firefox. This is helpful tool for debugging ember app. You can simply add it from webstore. You will see

Asynchronous Programming in C#

NowDays, In .NET world asynchronous programming went on to a next level and became more popular with the help of new keywords i.e async and await in C#. Recently we were using Async Await keyword while writing unit test cases in our project and found various issues in using them correclty. As users, we prefer applications which respond quickly and do not freeze when loading or processing data. While we are less patient with applications that keep us waiting. Even operating systems are becoming more responsive, and give you the option to terminate such misbehaving processes. If you have

Integrate Google Search Console with your site

What is search console? Google Search Console is a free service offered by Google that helps you monitor and maintain your site's presence in Google Search result. You don't have to sign up for Search Console for your site to be included in Google's search results, but doing so can help you understand how Google views your site and optimize its performance in search results. The tool gives webmasters the ability to find out if there are any specific problems that could be detrimental to being listed properly in the search results. These problems could be about how secure the

Use of DateFormatter in iOS using Swift

The DateFormatter help in the conversion between dates and textual representations. For example :- If you are working on the project and you are dealing with date or time to show in your app screen, the date or time format you receive is different from the format you want to display. Let say you got the date in "2017-11-15" and you need to display on screen as "15 November, 2017" so DateFormatter help us for conversion in the format as we want to display. Now let's see some more example for date and time conversion. Let

Sublime for Programmers - JavaScript and JS Frameworks

These days Javascript frameworks are part of, most of the development projects. We have to work on various JS frameworks over the period. Having good extensions/plugins added to our editor really makes our life easy and improve developer's development speed. So here I am listing some of the Sublime Text editor packages which are must for JavaScript and JS framework based projects. We use Sublime Text editor in our organization in most of the projects. Generally, people who are working in open source technologies are familiar with Sublime Text editor very well. However, people who are new to open

JavaScript callBack/Higher-order functions

Functions are objects in JavaScript, so you can store them in variables, pass it as an argument to another function and also you can return it from the function. Yes, function returning another function. CallBack functions are derived from functional programming and is also covered in advanced JavaScript topics but here we'll see that it is quite easy to implement. What is a CallBack or Higher-order function? It is a function which is passed to another function as parameter and is called inside that another function, therefore know as callBack function. Example of callBack function in jQuery: $("#btn"

"Lambda" Behind Functional Programming

I have been writing code in Imperative programming languages for many years. Writing code in functional programming is a big shift and change in thinking. As I recently started with Elixir and when I was reading about Functional Programming, I keep reading mention of Lambda Calculus every time. That ignited my curiosity to brush up my computer science knowledge. As Functional programming languages implement Lambda Calculus(λ-calculus). If we understand how Lambda Calculus notation works from Computer Science perspective it will be easier to understand Functional programming. As nowadays most of the languages have implementation of lambda calculus may it