Pages

Awesome chrome feature for Developers

Copy network call as cURL in chrome

Some times we try to see how some sites make call to servers to fetch data & we want to simulate to it from other clients e.g. cURL, other http request clients.

So here is little help for developers to copy any network request executed through chrome.

To do this just open developer console of chrome (Menu->More Tools->Developer Tools)
& goto to Network Tab


I am loading freeios8.com , you can see all resources are fetched from server and you can see each network call in network tab as shown below.


After loading website you can select & right click on any network call , It will provide you copying current network call in various formats. e.g. I am selecting here Copy as cURL option, refer below screen shot.


When you copy this call It will be available in clipboard.
You can paste it on command prompt/terminal & get same response as browser from respective servers.
Below is sample copied content with 'Copy as cURL' option.
curl 'http://freeios8.com/' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Connection: keep-alive' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Referer: https://www.google.co.in/' -H 'Accept-Language: en-US,en;q=0.8,hi;q=0.6,da;q=0.4' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36' --compressed
Note : To execute curl command make sure you have curl utility already installed on your system.

Wifi disconnects when you lock OSX screen ? then you should try this.

Consider when you are in middle of downloading something very important & in between you want to lock the screen, But screen lock will disconnect wifi which will stop your important download in progress If you are lucky enough, you can resume that download after re-login but wait what if it is not resumable ? So you have to start over again.

Lets find how we can lock the screen without disconnecting the wifi connection.

We can follow steps
1 . Create 'Screen Saver Service' using Automator 
2 . Bind this service with keyboard shortcut.

Now lets create Screen Saver service using Automator

You can learn some basic about creating simple service in mac Here
Just go to Applications & run Automator.app , choose "Service" as type for document as shown in snap below.




It will create empty workflow for your service. Then select "no input " as option for Service receives...checkbox.



Keep next checkbox option as "any application", Search Screen saver... in search box as shown below. It will filter "Start Screen Saver" Action for you, then add that action in your workflow by dragging it to right side panel.




After adding this action your workflow should look similar to below snap. You can test this workflow by hitting Run button at right upper corner.




Finally save this service with any name as you want. I saved it with name "screen_saver_service".




Then open System Preferences & & goto Keyboard shortcut by following path as
System Preferences->Keyboard->Shortcut Tab->Services option ,
refer below snap





Here you will see  service "screen_saver_service" already listed in General section, you just need to set key combinations to invoke this service as per your liking. Now you are good to go for locking your screen by pressing keys you just set.


Delete unwanted emails from Gmail in One go.

Daily checking emails is good habit but most of us are very lazy to do it or we get lots of mails daily that we can not read/delete such emails on daily basis, due to this we end up owning thousands of unwanted emails in our Inbox, Same case was with me. So I finally found way to bulk delete emails from Gmail inbox & I am sharing same with you.

Follow below steps to get rid of those unwanted emails

  • Login to Gmail ( Not need to say)
  • You will see search bar at top with small arrow at end , as shown in below snap
gmail-search-bar
  • Click that arrow.
  • This will open search/filter form where you can input search criteria, e.g From, to, Subject of mail, Has attachment, Date within fields... etc
gmail-filter-form

  •  Now you can add email id (even you can use part of email address here) in Form field to search all emails matching that criteria. you can refer following example where I am searching all mails from @parsemailer.com and date within "1 year". After you all criteria inputs just hit search button.


gmail-filter-form




  •  When Gmail done searching for your filter, It will show all emails matching your input criteria. 

gmail-filter-selection

  • If you have results more than single page you have to select all the results before performing any action on them, To do this just go to menu,which is just below search bar. It will show options which you can apply on results. As we want to delete all filtered results, just go for "All", It will select all results on the first page. Gmail assist here by displaying message like All 50 conversations on this page are selected. Select all conversations that match this search So you can select all filtered results at same time and do action on all items in one go. You can follow below snap for doing this.

gmail-filter-results


  • When you click Select all conversations that match this search  link all result items will get selected Then you can perform your action (delete, archive...etc) on these items. At this stage you can perform delete those items and free your Inbox.




Hope this will help to clean your inbox a bit ...