Desktop app for Facebook Workplace for Mac and Windows

workplace_share

Facebook officially launched it’s Slack competitor in late 2016 targeting the corporate teams. It’s fairly new and frankly it has hardly any new features besides the regular facebook that helps your productivity like Slack or Microsoft Teams does.

But we thought to give FB Workplace a try and one fine day, we ditched Slack. Major reason for the decision was the competitive price point, and we knew the features part would be fulfilled by FB soon.

A minor problem besides the feature problems was that there was no app for facebook Workplace, which felt less productive by going to a browser and switching to the tab everytime there’s a message, or a need to message someone. So I thought to create a wrapper app for Mac OS which you can quick open like any other app, it nicely sits on your Dock, get notifications just like any other application, and very quick to reach at.

workplace-dock

fbwok

Facebook Workplace app docked in your Mac OS Dock

 

Note that it’s not an official app from Facebook. It’s simply a wrapper that helps to use it like a Slack app until Facebook comes with an official version.

Steps to use: Just unzip the file, and run the Workplace.app file. If you want to quickly access the app everyday from your spotlight / search, you can put the app in your /Applications folder

 

Download link: GitHub

Download size: 38.8mb

Make sure you allow apps download from places outside App store. You can follow a guide here.

 

Hope it helps.

If you do need a windows version, do comment below. I’ll make one and update the link here.

Creating Twitter application in PHP

In this post we will look into accessing Twitter REST API in PHP. This can be useful if you need to post Tweets from your PHP application or anaylze, search Tweets. In the following examples we will use the twitter-api-php PHP wrapper for Twitter v1.1 API. Although there are a few wrappers around, this one I like for its simplicity.

Installation

If you use composer, here’s what you need to add to your composer.json file to have TwitterAPIExchange.php (Twitter PHP wrapper) automatically imported into your vendor’s folder:

{
    "require": {
        "j7mbo/twitter-api-php": "dev-master"
    }
}

You’ll then need to run ‘composer install’.

If you don’t use composer, just download the zip from git and include TwitterAPIExchange.php in your application path.

Registering your Twitter app

Before writing any code, you will first need to create a Twitter app and register it onhttps://apps.twitter.com/. You will be greeted with the following screen. (The following screenshot shows you an existing app. If this is your first app than the page will be blank).

twitter-app-1

Click on the ‘Create New App’ button and enter the required details in the fields provided. Leave the ‘Callback URL’ field blank for now. Once the app is created, click on the app name and note down the various access and security tokens, we will be needing these later. Change your Access Level to ‘Read and Write’. ‘Read Only’ access does not allow you to update, add or delete Tweets. If your purpose is to only read tweet data, it is safer to set the Access Level to ‘Read Only’.

Note that you will need to regenerate the access tokens if you change the Access Levels anytime and modify the same in your PHP code.

twitter-app-2

Accessing the Twitter API from PHP

Now that you have created and registered a Twitter app, we can now use PHP to acccess the API. First include the ‘TwitterAPIExchange.php’ class and set various security tokens collected earlier.

require_once('TwitterAPIExchange.php');
 
$settings = array(
    'oauth_access_token' => "YOUR_ACCESS_TOKEN",
    'oauth_access_token_secret' => "YOUR_ACCESS_TOKEN_SECRET",
    'consumer_key' => "YOUR_CONSUMER_KEY",
    'consumer_secret' => "YOUR_CONSUMER_SECRET"
);

For this example we will be using the ‘https://api.twitter.com/1.1/statuses/user_timeline.json‘ resource url. This returns a collection of the most recent Tweets posted by the user indicated by thescreen_name or user_id parameters. This particular method is one of the dozens of various methods available to access and modify Twitter data; others can be found here.

A complete GET request method is shown below. Here we are requesting the recent 3 tweets for the user ‘johndoe123’.

$url = "https://api.twitter.com/1.1/statuses/user_timeline.json";
$requestMethod = "GET";
$getfield = '?screen_name=johndoe123&count=3';

Once we specify the request methods and fields, we can call Twitter.

$twitter = new TwitterAPIExchange($settings);
 
$response = $twitter->setGetfield($getfield)
                    ->buildOauth($url, $requestMethod)
                    ->performRequest();

The complete code is shown below.

<?php
 
require_once('TwitterAPIExchange.php');
 
$settings = array(
    'oauth_access_token' => "YOUR_ACCESS_TOKEN",
    'oauth_access_token_secret' => "YOUR_ACCESS_TOKEN_SECRET",
    'consumer_key' => "YOUR_CONSUMER_KEY",
    'consumer_secret' => "YOUR_CONSUMER_SECRET"
);
 
$url = "https://api.twitter.com/1.1/statuses/user_timeline.json";
$requestMethod = "GET";
$getfield = '?screen_name=johndoe123&count=3';
 
$twitter = new TwitterAPIExchange($settings);
 
$response = $twitter->setGetfield($getfield)
                    ->buildOauth($url, $requestMethod)
                    ->performRequest();
 
print_r($response);

Executing the above code will return the recent 3 tweets for the given user in JSON format. You can specify the number of tweets to return using the ‘count parameter. The maximum that can be returned is 200.

$getfield = '?screen_name=johndoe123&count=3';

Note that all GET fields for this method are optional. Not specifying any GET parameters will return 20 recent tweets for the current user, i.e the user with the given access tokens. You can query without the GET parameters as shown below.

$url = "https://api.twitter.com/1.1/statuses/user_timeline.json";
$requestMethod = "GET";
 
$twitter = new TwitterAPIExchange($settings);
 
$response = $twitter->buildOauth($url, $requestMethod)
                    ->performRequest();
 
print_r($response);

Also, the response is returned in JSON, so will need to decode the JSON first before working further.

$tweets = json_decode($response);
print_r($tweets);

The tweet is stored in the ‘text’ field of the response, so we can enumerate all returned tweets with the following. Various other fields can be accessed in similiar manner.

$tweets = json_decode($response);
 
foreach($tweets as $tweet)
{
    echo $tweet->text . PHP_EOL;
}

Posting a new Tweet

Posting a new Tweet can be done with the following code, which uses a POST method instead of a GET. The initial code remains the same.

<?php
 
$url = "https://api.twitter.com/1.1/statuses/update.json";
 
$requestMethod = 'POST'; 
 
$postfields = array(
    'status' => 'Testing Twitter app'
);
 
$twitter = new TwitterAPIExchange($settings);
 
$response = $twitter->buildOauth($url, $requestMethod)
                   ->setPostfields($postfields)
                   ->performRequest();
 
print_r($response);

There are additoinal parameter you can use, the details for which are given here.

Searching for Tweets

Searching for Tweets based on a query is as easy as the above examples. Here in the following example we query for the ‘laravel’ keyword and ask o return 10 statuses.

$url = "https://api.twitter.com/1.1/search/tweets.json";
 
$requestMethod = "GET";
 
$getfield = '?q=laravel&count=10';
 
$twitter = new TwitterAPIExchange($settings);
$response = $twitter->setGetfield($getfield)
                    ->buildOauth($url, $requestMethod)
                    ->performRequest();
 
$tweets = json_decode($response);
 
foreach($tweets->statuses as $tweet)
{
    echo $tweet->text . PHP_EOL;
}

API rate limits

One important point to consider when creating your app is of rate limiting. Twitter limits the rate at which you query using their API. For example search will be rate limited at 180 queries per 15 minute window. More information can be foundhere.

Important Note

If the above examples do not work you will have to make a small change in ‘TwitterAPIExchange.php’. The curl processing part (around line 192) requires the line ‘CURLOPT_SSL_VERIFYPEER => false,’ to be added. So the curl part in the file should read the following.

        $options = array( 
            CURLOPT_HTTPHEADER => $header,
            CURLOPT_HEADER => false,
            CURLOPT_URL => $this->url,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 10,
        );
Childhood

Oh my childhood, could dream more than I do today

Ristair Corporation, Mau Creations, Ensigma Incorporation, Fonix Inc., and Deliti Education, and few more, were the ventures I wanted to build. Some in competition with Google’s search engine, some with an art and creativeness within, some with logic and business, some with Electronic components, and some with education-for-all in mind. So many dreams. One small kid.
But this is India. Your school teaches you no more than the age old textbooks; rather – chapters are skipped even from those textbooks based on time left for the exam. That’s the Indian education.
You learn no thing about real application of the education, what industry is, what world is, what people in US currently are working on, and what Indians are still doing. What we learnt? What everyone did in the past.
Science? Yeah, we did that too. We did a lot of theory. But we never made water, even if its as simple as H2O.
Sports? Eh? What’s that? We don’t study in an International school, so we probably have never heard that (just to point). Indoor yearly one small indoor basketball match (yeah, just stand below the basket and pour the ball).

In short, even with dreams, and goals, and talent, you really can’t make it up because you “actually” don’t know how do you utilize what you posses, and all you have is responsibilities of an Indian culture, family.

And I’m here today, as a normal employee (yet). But ofcourse, I’m not loosing hope. I’ll be back soon (Hopes), and with a bang.

An era of Carl zeiss phones

There were those days when mobile was still new for us. When mobile was still an excitement for us, a new and growing technology, a better medium of communication, and a lot of things that it could do.
And there was the camera when it was introduced in a mobile phone, everyone went crazy about it. You know more had to carry your rucksack sized backpacks with the camera and battery and everything else to cover and care them, because cameras weren’t any cheap accessories back then, nor are they today. And so having them in a portable “mobile” mobile phone, was just crazy, and awesome.
With time, there were many a phones with cameras, and then it was more about the camera then the mobile phone. As I say –

A phone memory is actually useless if it can’t store good memories.

And then happened Carl Zeiss. Making good memories. (Ofcourse not as good as today but it was a big and royal deal back in those days). When we went shopping for a good mobile phone, we used to breathe the device in an out, ie. from specs to looks. And once we have a device or two selected, we see – IF IT HAD A CARL ZEISS.

I liked to do things properly, even as a kid

An old note I found today for implementing a secured period subscription  functionality in one of my softwares

An old note I found today for implementing a secured period subscription functionality in one of my software

I was always like that. And still I’m, the same. I just don’t like to do things improperly. Eeven if there’s something random, I like to plan it, understand it, and do it nicely. Such that it looks good, works good, and is strong enough to even handle some surrounding issues that can be scoped in.

Like in this image above, it’s one of the pseudo code I wrote for myself, to plan and implement a robust and secured subscription functionality in one of my software product – OptiManager.
Subscription functionality might sound simple – periodic, but what if it is misused? if it isn’t implemented properly, people might end up hacking it easily and using copies of it freely. Specially in a case where you can’t handle every customer sitting on a desktop some miles away from you. Plus, desktop software always had this security problem, and all the extra troubles because you couldn’t access them remotely, like in web applications.

 

Hospy.co - Hospitals near you

Launching Hospy.co – Finding hospitals around you

Hospy.co launched, 29th July 2014, 11:54am, Mumbai, India.

Launched hospy while on bed rest since past 5 days. Some injections, some medicines, some bland-patient food, but finally bit stress free. It is Eid today, a good festival for islamic community. Celebrating by self, on the bed, 3 claps, some cheers (with coconut water).

Thanks everyone (I donno who) for all the support. Hope to give good time to Hospy along with other projects I’m working on. or atleast find a passionate team member / Business developer.

 

Hospy Logo Red

Elton

Futurama in 3D is absolutely stunning

This is amazing!

TECHCHURIAN

Futurama in 3D, Animation, Computer Animation, Illustration by Alexey Zakharov

Whoa. Artist Alexy Zakharov re-imagined the world of Futurama in 3D and transformed the cartoon into a complete stunner. It makes me want to watch a movie version of Futurama set in this world right now. Hell, it makes me want to cryogenically freeze myself so I can live in this world when I wake up.

Using 3ds Max, Nuke, Photoshop and After Effects, Zakharov was able to create a ‘test shot’ to see what his Futurama would look like. It’s so awesome. Here it is in full:



View original post

Introducing, Dragon V2

The new SpaceX Dragon V2

The new SpaceX Dragon V2 seems to be an amazing machine, capable of transporting seven astronauts to orbit and then soft-land anywhere on Earth using thrusters and retractile legs—with the accuracy of an helicopter. Elon Musk claims that they will be able to refuel it and launch it again right away.

LIVE COVERAGE (IN REVERSE CHRONOLOGICAL)

11:35PM ET. That’s all for tonight, folks. I’m excited to see this technology in action. Hopefully we will have more technical details soon. Good night!

11:34PM ET. Here’s the entire presentation. Jump to the 4:12 mark to watch the animation:

11:14PM ET. I’m uploading the animation now, but here are some images that show how the ship works.

The new SpaceX Dragon V2

Legs deployed, the Dragon V2 approaches its landing site. Elon stressed that this spaceship can land on any runway on Earth. I can’t wait to see it in action.

The new SpaceX Dragon V2

SuperDraco thrusters slowing the descent.

The new SpaceX Dragon V2

Dragon V2 during reentry, using their third-generation heat shield.

The new SpaceX Dragon V2

Inside, four astronauts on the front, three on the back.

The new SpaceX Dragon V2

The ISS with the two type of Dragons docked.

The new SpaceX Dragon V2

Dragon V2 docking with the ISS, with its nose cone open. Judging from the rendering, SpaceX will keep operating the original Dragon to ferry material to and from the ISS.

The new SpaceX Dragon V2

The astronauts in front of the four-screen glass cockpit, in a configuration similar to what you can see in modern airplane cockpits. There’s a central physical control panel.

The new SpaceX Dragon V2

The solar panels that power the electrical systems are on the skin of the trunk, which is a surprising configuration. The panels on the first Dragon were deployed separately. The trunk seems to be empty in the animation—I wonder if it could be used to carry depressurized cargo like the original Dragon. Notice how the nose cone opens on approach to the ISS for docking.

10:59PM ET. A few notes:

  • The interior is not completed yet. You are looking at the bare structure. There will be padding everywhere and other things too, I’m sure (although the animation doesn’t show too much detail.
  • Elon insisted that Dragon V2 will be able to be refueled and launched again without delay. I would be amazed if they can pull that (I’ve no reason to doubt it, given their track record, but it will be hard.)
  • Apparently the third generation heat shield would be able to endure multiple re-entries. That wasn’t completely clear in the presentation.
  • No word on first test date yet. Looking at the state of the interior, I think we are still far away from first launch, but I may be mistaken. The controls and the avionics seem to be there, but many other things seem to be pending.
  • Elon also showed their new titanium fuel tanks for the Draco and SuperDraco thrusters. Here’s an image of the new tank next to a Draco thruster.

The new SpaceX Dragon V2

10:50PM ET. Check out the retractile legs of the spaceship. Small and sturdy. Again, pure simplicity. Telescopic too! It really feels futuristic.

The new SpaceX Dragon V2

10:47PM ET. Here’s a photo of Elon opening the Dragon V2’s hatch. The entire thing looks so polished! I saw the space shuttle up close again on Tuesday and, looking at Dragon V2, it feels like it should have never existed (as much as I love it.)

The new SpaceX Dragon V2

10:37PM ET. Well. that was fast. The event is over.

10:35PM ET. The interior is cool too. Really spartan and simple. Look at all that big glass! I love how big and streamlined it is.

The new SpaceX Dragon V2

The new SpaceX Dragon V2

Elon getting inside.

The new SpaceX Dragon V2

Look at that hatch. The design looks so sleek—like a Tesla car.

10:33PM ET. Dragon V2 will be able to be fully reloaded and launched again right after landing, he claims.

10:31PM ET. Elon is explaining that Dragon V2 will retain the parachutes in case of emergency, but he says it will be able to land with its SuperDraco thrusters even if three engines fail.

The new SpaceX Dragon V2

10:28PM ET. Wow, this thing is really cool and slick.

The new SpaceX Dragon V2

10:25PM ET. Elon is on stage.

He says that when they designed Dragon 1 they still didn’t have a lot of ideas about what they could do. He claims that now they know: Dragon V2 will be able to carry seven people and soft-land with thrusters anywhere in the planet with helicopter accuracy!

10:11PM ET. Dragon V2 is so cool that it has transported the entire event into the future using exotic matter distilled from Elon Musk’s gonads. Hopefully we will get to the future soon and watch the webcast.

10:02PM ET. It’s time. Not Elon Musk yet.

9:58PM ET. We’re just two minutes away.

PREVIOUS COVERAGE (IN CHRONOLOGICAL ORDER)

The new SpaceX Dragon V2

This is a detail of the seat. On the top, part of a control panel and two cockpit glass, the screens where the onboard computers display flight information.

Elon Musk will officially present the new capsule starting at 7PM Pacific Time.

3:00PM ET. Here’s the last test for the SuperDraco thruster, which just completed qualification testing. This engine “will power the Dragon spacecraft’s launch escape system and enable the vehicle to land propulsively on Earth or another planet with pinpoint accuracy.”

The SuperDraco is an advanced version of the Draco engines currently used by SpaceX’s Dragon spacecraft to maneuver in orbit and during re-entry. SuperDracos will be used on the crew version of the Dragon spacecraft as part of the vehicle’s launch escape system; they will also enable propulsive landing on land. Each SuperDraco produces 16,000 pounds of thrust and can be restarted multiple times if necessary. In addition, the engines have the ability to deep throttle, providing astronauts with precise control and enormous power.

3:05PM ET. This is the updated Dragon logo used in their invitation to the presentation event.

The new SpaceX Dragon V2

3:10PM ET. This is how the current Dragon—which is used to ferry materials to and back from the International Space Station—looks now.

The new SpaceX Dragon V2

Nobody knows if the external design would change, but the interior design will change for sure to accommodate up to seven astronauts—as many as the space shuttle. Here’s an image of NASA astronauts demonstrating how they would fit inside.

The new SpaceX Dragon V2

3:15PM ET. This is not Dragon V2, but it may be Dragon V3. Lots of good speculation about the far future of SpaceX here.

The new SpaceX Dragon V2

3:16PM ET. There’s speculation that the next generations of Dragon may look radically different from the current one, as hinted by Elon Musk himself. Keep in mind that future versions of the manned Dragon capsule are supposed to soft land like a sci-fi spaceship, using the SuperDraco thrusters to guide the capsule and extending its legs to lag on solid land.

3:26PM ET. You can see how soft landing works looking at their Grasshopper prototype and the Falcon 9R. Here is F9R’s latest flight test, which reached one kilometer into the atmosphere to come back down and land.

And this is Grasshopper:

3:28PM ET. By the way, anyone knows what the code around the invitation means. Is it some kind of morse code? Any commenter knows morse or can figure out its meaning?

The new SpaceX Dragon V2

3:33PM ET. This conceptual video by SpaceX shows their vision of reusable everything, from rocket stages that come to soft land on Earth to the Dragon capsules.

4:00PM ET. SpaceX has just published a new view of the capsule. This time it’s part of the cockpit glass and a control panel.

The new SpaceX Dragon V2

5:04PM ET. This really looks very slick. The panel seems to offer mission time, a timer, alarms panel, power overrides and resets, chutes release, trunk release and emergency. On the sides there’s some cockpit glass panels. On the left there’s part of the avionics soft displays. On the right you can see some of the controls, including what it seems like a camera view showing the exterior view.

5:08PM ET. Less than five hours now for the unveil at 10PM ET/8PM PT.

5:11PM ET. One explanation for the circles around the dragon:

The new SpaceX Dragon V2

That’s the STORRM retro-reflector “installed on ISS during the STS-131 mission in May 2010:

STORRM (Sensor Test for Orion RelNav Risk Mitigation) represents a new sensor technology that will make it easier and safer for future (commercial) servicing spacecraft to rendezvous and dock to the ISS (International Space Station). The DTO (Development Test Objective) of this next generation navigation system is to advance the capability necessary for automated rendezvous and docking (determine shapes, intensity, and distance); the goal is to provide data from as far away as 5 km – three times the range of the current Shuttle navigation sensor.

Maybe there’s some relation and the circles and lines around the Dragon logo are an indicator of the docking abilities of the new Dragon V2 capsule.

5:21PM ET. Knowing Elon Musk, it seems that the presentation today will be pretty big, maybe as big as the Tesla Model X reveal?

I hope the Dragon V2 presentation includes https://www.youtube.com/watch?v=FZJLAo…Goldfrapp as its soundtrack too.

5:34PM ET. More on that logo, from a NASA Space Flight forum member:

The new SpaceX Dragon V2

Anyone has any clue?

5:40PM ET. Another NASA Space Flight forum member got a simpler explanation: It may be an stylized Dragon V2 capsule from the front. Here it is a comparison with the Dragon V1 to give you an idea:

The new SpaceX Dragon V2

5:44PM ET. And here’s another clever thing: If you do do a shadows & highlights in Photoshop you can see the seats reflection on the glass:

The new SpaceX Dragon V2

7:08PM ET. So much for the mysterious logo: A NASA Space Flight forum member found out that it’s just a Shutterstock vector image. Boo.