How to Setup Your Own Parse Server

Since you already have heard that parse is closing down. Here are some instruction to set up you own parse. You can read more about the announcement here. You Can set up Parse with heroku or AWS.

The guides are at:

Heroku: https://devcenter.heroku.com/articles/deploying-a-parse-server-to-heroku

AWS: http://mobile.awsblog.com/post/TxCD57GZLM2JR/How-to-set-up-Parse-Server-on-AWS-using-AWS-Elastic-Beanstalk

If you’re not sure which to choose I’d go for Heroku as the process is a fair bit more straightforward.

Happy Coding. Now you have your own backend.

Javascript – How to Create Functions to replace text, factorial, check if it’s even

These are some code snippets on how to create functions to check if a number is even. Do a factorial with a for loop. Do a text replacement with regular expressions.

// isEven f(x)
function isEven(arg) {
	return arg%2 === 0
}
// factorial f(x)
function factorial(num) {
	var result = 1;
	for(var i = 2; i <= num; i++) {
		result = result * i;
	}
	return result;
}
// kebabToSnake() Replace a string "-" with '_'s
function kebabToSnake(str) {
	var newStr = str.replace(/-/g , "_");
	return newStr;
}

Javascript – Simple For Loop Examples

These are some examples of simple for loop challenges and exercises I did for fun.

// Print 'hello' the string vertically
var str = 'hello';
for(var count = 0; count < str.length; count++) {
	console.log(str[i])
}
// print all numbers between -10 and 19

for(var i = -10; i < 20; i++) {
	console.log(i)
}

// print even numbers between 10 and 40

for(var i = 10; i < 40; i++) {
	if(i % 2 === 0){
	console.log(i)
	}
}
// print all odd numbers between 300 and 333
for(var i = 300; i < 333; i++) {
	if(i % 3 === 0){
	console.log(i)
	}
}
// print all numbers divisible by 5 and 3 between 5 and 50
for(var i = 5; i < 50; i++)	{
	if(i % 3 === 0 && i % 5 === 0) {
	console.log(i)
	}
}