Skip to content

Instantly share code, notes, and snippets.

View mojaray2k's full-sized avatar

Amen Moja Ra mojaray2k

  • Miami, Fl
View GitHub Profile
@mojaray2k
mojaray2k / this.js
Last active December 31, 2017 09:30
Javascript This
var Person = function(name, age){
return {
name: name,
age: age,
sayName: function(){
console.log(this.name);
},
girlfriend: {
name: 'Shireen',
sayName: function(){
@mojaray2k
mojaray2k / bind.js
Last active December 31, 2017 09:14
Javascript bind
var myCountry = function(lang1, lang2, lang3) {
console.log('My country is ' + this.name + ' and I know ' + lang1 + ', ' + lang2 + ', and ' + lang3 );
}
var country = {
name: 'United States of America',
citizen: true
}
var languages = ['English', 'Spanish', 'Arabic'];
@mojaray2k
mojaray2k / call.js
Last active December 31, 2017 09:07
Javascript call
var sayName = function() {
console.log("My name is " + this.name);
}
var shireen = {
name: 'Shireen',
age: 26
};
// The this keyword is the first argument passed to the "call" parameter
@mojaray2k
mojaray2k / apply.js
Last active December 31, 2017 09:06
Using the Apply parameter
var myMajor = function(lang1, lang2, lang3) {
console.log('My major is ' + this.name + ' and I know ' + lang1 + ', ' + lang2 + ', and ' + lang3 );
}
var cs = {
name: 'Computer Science',
enrolled: true
}
var languages = ['Javascript', 'Ruby', 'Python'];
@mojaray2k
mojaray2k / Commands.sh
Created December 30, 2017 15:01 — forked from nrollr/Commands.sh
Install PHP and NGINX on Amazon Linux AMI
## Install NGINX
$ sudo yum install nginx -y
## Install PHP and PHP-FPM
$ sudo yum install php -y
$ sudo yum install php-fpm -y
## Configure NGINX (see below)
$ sudo nano /etc/nginx/conf.d/default.conf

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

@mojaray2k
mojaray2k / expose_rest_endpoints.md
Last active April 27, 2017 07:20
Expose Custom Endpoints In The WordPress Res API

#Get the Featured Image, Category, Tags, etc of a Post via the WordPress Rest API

Just Place the follwoing code in your functions.php file.

/*
    Prepare REST
*/
function get_rest_endpoints($data, $post, $request){
    $_data = $data->data;
@mojaray2k
mojaray2k / ssl-cpanel.txt
Last active April 3, 2017 18:51
This guide is how to Install SSL on the Cpanel Interface.
1. Go this this site https://www.sslforfree.com to get 1 free SSL
2. Input your domain and press create
3. Coose Manual Verification and click Manual Verificaiton domain
4. Follow those steps which the guide on that link via Cpanel
5. Open Cpanel and go to file manager to create a folder on public_html calll .well-known
6. And then in the well .well-known directory create a folder called acme-challeng
7. Then download the two manual verification files
8. Then download the SSL
9. Then in Cpanel got to SSL/TLS
10. Upload the private key from the SSL
@mojaray2k
mojaray2k / index.html
Created April 3, 2017 08:17
JS Bin rxjs click count app // source http://jsbin.com/bodaho
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="rxjs click count app">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<button id="click-me">Click Me !</button>
@mojaray2k
mojaray2k / index.html
Created April 3, 2017 08:00
JS Bin rxjs error handling operators // source http://jsbin.com/gakewuw
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="rxjs error handling operators">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://unpkg.com/rxjs/bundles/Rx.min.js"></script>