console.log("Listening for ACME tls-sni-01 challenges and serve app on",this.address());
I wanted to set-up a multi-domain SSL certificate using LetsEncrypt for my app “Dead Simple Screen Sharing” because people complained about the long meeting URL, so I bought a short domain mnow.io and edited the code to generate short 6 digit meeting ids, so the new meeting URL became much cleaner e.g https://mnow.io/345686 instead of the original https://app.deadsimplescreensharing.com/meeting/bgasGca-1
But I needed a new SSL certificate for the domain mnow.io, and as this domain will also be pointed to the same server, I required a multi-domain SSL certificate.
I had already configured greenlock-express (letsencrypt-express is now called as greenlock-express) on my server so just had to make some changes in the configuration and add my domain, but simply adding the domain in the domains array didn’t work, so after some trial and error I finally figured it out.
Here is the final code snippet, that you can use, add this in your app.js or server.js:
console.log("Listening for ACME tls-sni-01 challenges and serve app on",this.address());
In line 10 replace ‘domain1.com’ and ‘domain2.com’ with your own domains, if you have more than 2 domains you can add them in the array, if you have only one domain then you also keep just one single domain in the array.
In line 12 replace ‘firstname.lastname@example.org’ with your email address.
The code on line 19 to 23 is optional, you can add it if you want to redirect all your traffic to https, and if you skip it then both HTTP and HTTPS versions of your site will be live.
Let me know if you have any questions, concerns or suggestions in the comments.
In the blog post, I will guide you through the process of setting up a static homepage for your WordPress blog when using the default TwentySeventeen theme.
The process of setting up a static homepage for your blog is straightforward. follow the steps below to make it happen:
Step 1: Upload your static homepage
The first step will be to upload your static homepage into your site, to do this you’ll have to FTP or SFTP into your blog, you can find the information on how FTP into your blog from your hosting provider and you can use a program like FileZilla or Cyberduck to FTP into your blog.
After you connect to your blog via FTP/SFTP go to the themes folder of your WordPress installation, usually it is located at htdocs/wp-content/themes/<theme_name> as we are editing the default “twentyseventeen” theme in our case the theme_name will be twentyseventeen htdocs/wp-content/themes/twentyseventeen
Then in this folder, there will be a file named front-page.php, rename that file to front-page-old.php, if we don’t rename this file then WordPress will server this page as the homepage, so we have to change the name of the file from front-page.php to something else.
After you have renamed the file, create new file name page_home.php in that folder, and paste the following contents into that file:
// Template name: Static Front Page
After the ?> tag paste the html content of your homepage in this file and save the file.
Now go to the htdocs folder and upload all the other static HTML pages you want to upload and CSS files associated with your homepage.
Step 2: Updating Settings in WordPress
Login to your WordPress Admin panel, Go to Pages->Add New, and create a new page with title Homepage and from the Page Attributes section select the Template as “Static Front Page” as shown in the image below, and save the page.
Then we will also need a page to show our blog posts, Go to Pages-Add New and create another page, with title Blog, and edit the permalink of the page to /blog.
Then go Settings->Reading and in the section where it says “Front page displays” select “A static page” and from the drop-down select “Homepage” as the front page and “Blog” as the Post page.
Step 3: That’s it!
Following the above simple steps, you can setup the static homepage, let me know if you have any questions in the comments.
This blog post is about a project that I have built, which is called DeadSimpleScreenSharing 2, which the next version of DeadSimpleScreenSharing, and it is much better and faster than the previous version.
It offers audio conference out of the box and supports sharing your screen with any number of users just by sharing a URL, and it is very high quality and super fast.
I am also offering a self-hosted version of the application that you can run on your own server, and the self-hosted version is also white label so you can rebrand it with your organisation’s brand name.
So, here is how you can use this super simple service:
Step 1: Go to http://deadsimplescreensharing.com and click the “Host a Meeting” button
Step 2: It will take you the chrome extension page, where you’ll have to install the extension
Step 3: After installing the extension, click the extension icon, and a window will appear, in that window click the “Host a Meeting” button
Step 4: Done! Your screen is being shared, you can share the URL with others so that they can join your session.
Facebook killed parse last year, but thankfully they Open-Source the parse backend. Initially, the Parse Backend only supported MongoDB database, but later support for Postgres has been added by the contributor from the community.
So using Postgres with Parse Backend is really quite simple, you just have to install the latest version of Parse Backend, and in the databaseURI specify the Postgres connection string.
Marketing and selling products and services for your newly created startup can be a difficult preposition. But, it can easily be done if we think about it logically.
For the sake of understanding, let’s assume we have a SaaS (Software as a Service) startup. We sell something that helps early stage entrepreneurs build their enterprises.
Defining a Persona
Now lets have a look at who our customer is and try to build a persona of our ideal customer.
Some things to consider:
Aspirations in life.
Where does he/she lives
For our startup, our customer is the founder of an early stage startup, and his name is Mike.
Mike is a male
He is 27 years old
Mike lives in San Francisco,
Single and a graduate in business,
Mike has a job and makes around 100k/ year.
He wants to start a startup and make it big in life.
Mike does’t know programming or design and has to rely on other people for these skills.
Now, we have got Mike but,
Mike doesn’t know about us
nor about our awesome product that is going to help him make it big. We have got to find him and tell him.
Where can we reach mike?
We might be able to meet mike in places where he generally hangs out, like:
On the Social media sites:
And Website which provides startup news and updates:
Apart from this Mike is also reading stuff about entrepreneurship and success on sites like:
Mike also does a lot of things in the physical world:
Mike visits technology meet-ups.
Mike visits coffee shops, building his business plans
Mike visits trade fairs.
What does mike want ?
Since Mike is starting a early stage startup, he is probably looking for ways to:
build a website,
Build his product
Market his product,
Looking for people in his network who might be be interested or willing to help him with his startup.
Maybe he is trying to pitch his idea to investors
Looking for a small office space or a Co-working space among many other things.
Mike might even be looking for his early employees or freelancers perhaps. That might be designers and
developers to help him build his product.
At this point in time we have got Mike with his early stage startup and we know what does Mike wants and the places where he hangs-out and the people he hangouts with.
Now we have got to get to Mike and help him succeed in his startup.
Why do we want to do that ?
Because Mike does not want to buy our SaaS product. Mike wants to succeed in his business. And we are not going to sell our SaaS product to him. Mike will buy a resource from us that is going to help him achieve success in his business.
Marketing that does not look like marketing is the best kind of Marketing.
Up till now what we have done is
Customer Profiling: Identifying who our customer is.
Identifying distribution channels: Finding out where our customer is.
From now on, We will help our customer find us.
There are two ways we can get this done.
In the physical world.
Over the internet.
We can choose both ways or we can choose any one based on our resources and which we think might work best for our product.
The Physical World
We can go to the meet-ups, where mike is hanging out.
To the coffee shops where he is working on his business plans.
To the trade fairs where he might visit to sell his product.
Out-side Co working spaces where he might be visiting.
We can talk to him and tell him about our product and how we can help him.
Find out his contact number/email and call him or email him.
Cold calling is an awesome sort of Marketing, you just need to know whom to cold call and how to execute. People out there have real problems to solve and if we can help them. It is going to be great business.
(One of the biggest examples of cold calling working is today’s business environment is AppAftercare app maintenance business by Einar Vollset.
It is an awesome company, He even runs a course explaining how he markets his products.)
And we can speak to Mike, tell him how awesome our product is and how he is going to be huge success by using it.
Over the internet
We have already figured out where Mike hang outs over the internet, We just need to reach out to him and help him out with his Business.
Building a Side Project.
1. Building a Side project.
A side project can be a website or a tool that does some kind of leg work for Mike.
Mike needs to get a lot of things done.
He needs a Website, a logo, he needs legal stuff done, he needs to find designers and developers, he needs productivity tools. He needs to learn basics of coding or design. He needs photos for his blog or social media posts etc.
If we can build a tool or a side project that can help Mike in achieving his objective. He is going to come finding us.
One of the awesome companies that are doing this kind of thing is: Buffer
Buffer is company that helps entrepreneurs schedule their social media posts. They need to attract people who are into social media.
They have a side project called:
Pablo is website that helps you design images for your social media posts. This solves a big problem for Entrepreneurs and social media marketers.
When Mike is searching for photos for twitter post and he stumbles-upon Pablo.
He gets to know that there is this SaaS company called Buffer which helps him save time
on his social media marketing and he is likely to buy from them.
Blogging is a very well known tool for inbound marketing. But what to blog is thing to consider. We need to only blog things that are going to help Mike.
Actionable content, Content from which mike can take away something from and apply to his life and business and get results.
A study by New York Times, claims that the likelihood of an article being shared is the most for articles with
practical utility. articles with actionable content gets shared the most.
Ideas to blog about?
We already know a lot about Mike. Lets just think what would be the core idea Mike would like our advice on?
Answer: Entrepreneurship and success.
Well, this is just one thing. What are the other complimentary things we could help Mike with.
Getting startup ideas
Validating startup ideas
Building an MVP.
Getting funding etc.
Apart from writing an article, you could also make video or podcasts or slide-share. But the basic idea between all these mediums is the same, that is to help the customer achieve success in his/her pursuits.
And writing an article is just not enough. We will have to tell Mike we exist and here is an awesome article which would be a great help to him.
Distributing your Side Projects/Articles and doing SEO:
Well we have a great SaaS product, a great tool to help Mike and we are also writing awesome articles.
How are we going to make Mike come to us?
Well we know where Mike hangs out on the internet. We can just through stuff on the social media and hope and pray that Mike reads OR we can be proactive in our efforts to reach Mike.
Now, there are certain people on social media who are called influencers. These people have a large amount of following.
We will need to find out certain influencers who would be interested in distributing our free tools and blog articles to their network of people on social media.
How we are going to do that?
With a certain tool called as Followerwonk, which is available at MOZ.com It helps us sort influencers on twitter with certain keywords in their profile or bios.
for example. If our tool is an open source product. we will sort people with open source in their bios and see if they post other people’s open source products on twitter.
Then we will contact them and ask them to distribute our product.
We could do something similar for product hunt as well. Product hunt is an awesome network that lists digital products.
Though we don’t have followerwonk for product hunt. Product hunt has hunters and we can contact them on twitter and ask them if they will hunt our product.
This same thing we are going to do with our Blog article. One thing to remember though: The quality of our content should be top notch. The better the quality of our product the more viral it will become.
One very good side effect of this will be people will start linking to our blog or free product page.
For example some one is writing some post and they might link to us as a reference. This is going to increase our SEO.
Or someone might be listing free resources for Entrepreneurs and
businesses and they might list our product.
Alternatively, we can also search for blogs on google.
Just typing in Open source software blogs or Entrepreneurship blogs and Google will give us a list if blogs and we can contact those blogs and ask them if they can list or add a link to our free product site or blog article.
Build an email subscription list:
Always try and build a subscription list. The people who are subscribing to your articles really believe in your content. And you should make them search for your articles from time to time.
They are a dedicated audience and dedicated traffic to your blog. Do your upmost to make it really easy for them to signup to your mail list.
What is SEO ?
SEO is search engine optimisation. What is means is that When mike does a google search for a product or problem that we could solve our website ranks higher in the search ranking.
To increase search ranking there are many things Search Engines consider. Among them are
Number of links connecting to our site
Traffic coming to our site
Number of social media posts of our site.
What are Keywords?
Key words are words Mike might type into the search engine bar to find something he wants to find.
For example if Mike wants to hire a mobile app development company, He might search
mobile app development companies in San Francisco. or hire mobile app developer.
We need to research keywords that are relevant to our industry and customer
Typically we should try to rank in the top three keywords our customer would search.
Now there are two kinds of SEOs.
Here is a very good guide to Onpage SEO.
For finding out keywords
“will searchers really find what they are looking for when they search using using these keywords?”
Find out what key words competition is using. Tools like Open web explorer and SEM Rush are a great for this kind of research
and google keyword planner is another great tool for keyword research. It tells you how much traffic is there for a particular keyword. It even tells you how much difficult it is to rank for a particular keyword.
And we already have been doing a lot of off page SEO by building free products and Blogs.
Just be sure to sub-domain your free product page and blog site to your startup site.
After getting an understanding of keywords. DO a quick on page SEO. It doesn’t take much time is simple to do and the results are for ever
here is a quick guide.
These key word tools tools will also come in handy when distributing blog articles
Doing Paid Ads.
If we have the budget or if we want to do experiments we can use paid ads for this purpose.
Building a paid ad is an skill unto itself
We will need to answer questions like these ?
What is the goal of the ad?
The goal could be to drive signups, or
influencing people to read our blog post
converting people to buy our product.
What keywords to target?
Key word targeting in ads is a skill. You need to find key words that drive traffic but aren’t that expensive to buy.
We discussed some of the tools we could use above.
Which platform to choose?
Ideally we should only choose platforms where our customers visit (mike). Another thing to consider is what mood mike is in when he is on a particular platform.
Research shows that for long form content twitter is a good source, for relaxed entertaining content Facebook is good media.
For getting conventions search engine ads like on google and bing are a good source.
Other things to consider:
What ROI do we want, and at what cost ads are feasible for us.
What does a client pay us VS How much does it cost to get the client is an important thing to consider.
Assuming our goal is to convert the client to buy our product.
Income from client > How much money a single click costs * How many clicks are required to get the client.
Marketing like everything else in life is a trial and error thing. All of the things will not work everywhere.
And running with all the strategies and all the distribution channels that I have mentioned is a not a good idea especially when your resources are limited. Instead try and identify what channels suits you the best and work with it.
So many times it happens that one of the channels brings in more customers than all of the other channel combined.
I wish you best of luck for your adventures.
This blog post is by Mohammed Lakkadshaw. Founder at Mohammed Lakkadshaw & Co. A Mobile and Web design and development company.
For my recent angularJS application, I needed to integrate Mixpanel.
I didn’t found any light-weight directives which I could include in the application that would allow me to easily track events using Mixpanel in the application, so I built Mixular.
Mixualr is a lightweight angularJS directive which you can use to track events in your application.
I was looking for a Node.JS web framework for my project, and in my quest for finding the best framework, I stumbled across Sails.JS, and I have been using it for a few months now and it is pretty awesome at most of the part, so if you need something like Rails for Node.js, Sails is the way to go.
The Sails.JS is an MVC framework, so there are Models, Views and Controllers.
In Sails.JS you can create models, and model represents the data model, so if for each table you would have a model and in case of no-sql databases, each collection is represented by a model.
Inside a model you can describe, the attributes present in that model, their datatype and validation rules.
Example of a User Model:
In the above example we have a user model, which has a number of attributes, like firstName, lastName, email and role.
The model structure is pretty straightforward, and Sails.js provides some useful helpers in modules like the enum.
We have added an enum attribute in role, now Sails will accept only the values present in the enum array.
The magical part is sails is blueprints. Sails will create CRUD routes based on the data model.
Sails will look at your data-model and will create blueprint routes and REST api.
So, by looking at the model we have created above sails will create REST APIs. Create User: HTTP POST: /user Update User: HTTP PUT: /user/:id Delete User: HTTP DELETE: /user/:id Fetch User: HTTP GET: /user/:id Get All Users: HTTP GET: /user
Associations in Model
In Sails you can associate one model with another model, and associations can span across databases.
So if you have user data stored in Postgres and photos stored in Mongodb, you can interact with the data if they lived in the same database.
Many to Many
In this type of association, one model can be associated with many other models and vice versa.
Lets consider an example of a Real Estate, a Real Estate can be owned by multiple people, a person can own multiple Real Estates.
Thus we can create a many to many relationship between people and real-estate.
So, let’s begin:
So, in the above example we have created two models, one is user model and another one is estate model.
In the estate model we have created a property named owner, which reference the user model model and points to the owners of the property, so this will be an array containing all the owners of the property.
In the User model we have created a property named estates, and it points to the estate model and it will contain all the estates owned by the user.
LifeCycle callbacks in Models
There are lifecycle call-backs present in the models which are very helpful, for e.g: If want to can write some cleanup code when an item in a model is deleted, so you can write the code for that inside the afterDestroy method.
The main logic of your application will be present in the controllers, the controllers are responsible for responding to the requests.
Although, some magic is provided by Sails, using blueprints to create automatic CRUD API, often times it is not enough and you will want to add more functionality and more types of routes.
Consider an example controller file name greeting.js:
The above file contains two actions, namely hello and hi, inside these actions we can write the code to do whatever we want, in the above example we are sending messages, “hello world” and “hi user” respectively.
Sails has automatic routing, so the controllers and actions that you have created will be routed automatically, by the following format /:controller/:nameOfAction.
So routes for our above actions will be /greeting/hello and /greeting/hi.
Overriding blueprint actions
If you want override the blueprint actions, like create, update or delete, just create actions in the controller with that name and it will override the default functionality.
Suppose we want override the create functionality for user, so in user controller, we will create an action having the name create.
The above code overrides the create functionally, now if we send a http post request at url /user, instead of creating a new user it will send a response “Hello world”.
In the similar manner we can override the default behaviour by creating actions having the name create, update and delete.
You don’t want anyone accessing and performing unintended activity, like deleting all your real estates, so for that we have policies.
If you are familiar with ExpressJS, polices are similar to ExpressJS middle-wares.
The official SailsJS documentation explains policies in great detail, be sure to head over there and read about it in details.
That’s my take on SailsJS, it’s a great framework to build apps in Node.JS.
Let me know if you have any suggestions, questions about this in the comments.
It is a tedious job to write api documentations, and we have been using word documents and excel spreadsheets to create api documents.
But they are difficult to follow and search though, what if there was an easier and cleaner way to create API documents? When I started working on my latest project I was searching for an efficient way to write API documents and a way to generate beautiful documentations, my quest for finding the best api documentation tool lead me to API Blueprint.
What is API Blueprint?
API blueprint is a language based on Markdown which allows you to write API documents clearly, moreover, it has great tools which takes in your API blueprint document and convert it into beautiful HTML API documentation and much more.
Here are some tools which I find useful, that you can use with your API documentation written using API Blueprint. These tools make the API blueprint documents very powerful. There are tools generate beautify HTML documentation to even create mock API servers.
Creating Online documentation:
There is a web app called as Apiary, which allows you to write in API blueprint format, and it generates beautiful online documentation, it also provides mock API server which will emulate your API based on the documentation, which is pretty useful if you don’t have the API server ready yet and want to use the APIs for prototype the applications.
It will allow you to quickly build and test the API, without writing a single line of code.
API blueprint document into HTML documentation
There is an awesome tool called Aligo which will allow creating beautiful HTML documentation from the API blueprint document.
The above script will print out all the supplied arguments, when executed it will generate the following out:
$node script.js argument-1-f-k-d
To remove ‘node’ and path from your script can slice out those arguments:
There several libraries out there that will make the task of accepting arguments easier, but if you are doing something trivial, I would suggest sticking to the default method.
One notable example of such library is cli.
Colors on the command line
If you want to display messages with different colours, there is a nice library called as colors to do it effortlessly.
Install it via nom:
$npm install colors
And then include it in your script:
console.log('hello'.green);// outputs green text
console.log('i like cake and pies'.underline.red)// outputs red underlined text
console.log('inverse the color'.inverse);// inverses the color
If you want to preform some operation on exit, you can listen to the exit event. Once the exit event is called there is no way to prevent the exiting of the event loop, hence you must only perform synchronous operations in this handler.
console.log("About to exit");
Node.js provides supports for exit codes, if you script exits without any error, the exit code should be 0. If your script exits with an error it should be 1 or higher.
Exit codes in node.js are passed using process.exit().
Returns the number of seconds the script has been running
Returns an object describing the memory usage
The PID of the process
If you have any questions or suggestions feel free to comment.
I am big fan of sublime text, and I use it extensively. Then I came across WebStorm, I like it and I want to learn more about it, because any craftsman should know how to use his tools effectively.
So I was looking for some tutorial and videos on mastering web storm and I came across this excellent video by John Lindquist. I highly recommend that you watch the video.
I have also tried to summarise what’s there in the video, but I recommend that you watch the whole thing, but for those who cannot spare the time to watch the whole thing, here is the excerpt:
Webstorm offers a nice code inspector, and to inspect code, right click on any directory inside Webstorm and click inspect Code.
It will give you a list of the issues and warnings and improvements which you can make, and is kind of really useful when your are doing code reviews and stuff like that.
Autocomplete Shortcut: Whenever a small bulb appears in Web storm, it indicated that Webstorm has some suggestions, and you can hit alt+Enter to bring the menu which shows the suggestions.
Go back in time: Webstorm has a nice auto-save feature, you don’t have to manually save things in Webstorm, and when you have changed something and want to revert your change you can go back in time by: Right-click-> local history
Getting things from CDN: When using CDN in script tags and stylesheets src, Webstorm will show a warning, you can hit alt+Enter->Download locally, by doing that it will download the linked file and show autocomplete off that.
Fine tune suggestions: In Webstorm you can fine tune the settings about auto-complete, suggestions, warning and errors.
Click on the lower right hand side corner->on hector the inspector and fine tune the inspection
Cmd + Shift + A bring the action bar.
Select content, and press cmd+shit+a and select create live template.
And add variable by $name$ and $end$ to specify where the cursor ends.
Webstorm uses velocity template language.
Refactor this shortcut CMD+SHIFT+ALT+T
/+tab automatically generate the document
**Cmd+Alt+V to pulling out variable.
Open up the file structure: can also be invoked by cmd+f12
To navigate project: cmd+shift+n, wildcard are also supported
cmd+alt+shift -> type the name of the method
and cmd+shift+i while doing this, will also show preview of the file, and cmd+shift+j while doing that will show documentation if available.
Webstrom also has an integrated VCS manager, to bring the VCS Popup hit Ctrl+V.
Webstorm is also integrated with Github, you can easily import your github repos in Web-storm.
To add external tools, go to Preference -> External tools and add details about the external tools you want to add, for e.g. Yeoman
If you create a coffee script file, it will ask you to add a watcher, and it will generate the corresponding js file, same if for sass etc.