Skip to content

Instantly share code, notes, and snippets.

View Davisonpro's full-sized avatar
🎯
Focusing

Davison Pro Davisonpro

🎯
Focusing
View GitHub Profile
@Davisonpro
Davisonpro / index.php
Last active October 22, 2019 11:38
The main entry of our website
<?php
$user = (object) [
'name' => 'Jane Doe',
'email' => 'janedoe@gmail.com',
'logged' => true
];
?>
<!doctype html>
<html lang="en">
@Davisonpro
Davisonpro / package.json
Last active February 27, 2019 12:24
Our react app package.json file
{
"name": "react-php",
"version": "1.0.0",
"description": "Setting up php and react web app",
"main": "index.js",
"scripts": {
"build": "webpack --progress --env.NODE_ENV=production --mode production",
"watch": "webpack --colors --debug --display-chunk -w --env.NODE_ENV=development --mode development"
},
"dependencies": {
@Davisonpro
Davisonpro / webpack.config.js
Created January 9, 2019 18:34
Our app webpack configuration
'use strict';
const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
let config = {
entry: {
main: [
'./_devapp/app.js',
@Davisonpro
Davisonpro / app.js
Last active October 22, 2019 11:38
App.js file
import React, { Component, Fragment } from 'react';
import { render } from 'react-dom';
import { asyncComponent } from 'react-async-component';
/** We are importing our index.php my app Vairaible */
import myApp from 'myApp';
class Myapp extends Component {
render() {
@Davisonpro
Davisonpro / index.js
Last active January 13, 2019 11:12
Node js SSL
const express = require('express'),
chalk = require('chalk'),
fs = require( 'fs' );
const pkg = require( './package.json' );
const start = Date.now(),
protocol = process.env.PROTOCOL || 'https',
port = process.env.PORT || '3000',
host = process.env.HOST || 'localhost';
@Davisonpro
Davisonpro / package.json
Last active January 13, 2019 10:32
Nodejs SSL
{
"name": "nodejs-sll",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "nodemon index.js"
},
"keywords": [],
"author": "I am a pro",
@Davisonpro
Davisonpro / genereate-certificate.js
Created January 13, 2019 11:13
Generate certificate
if ( ! fs.existsSync( key ) || ! fs.existsSync( certificate ) ) {
try {
execSync( 'openssl version', execOptions );
execSync(
`openssl req -x509 -newkey rsa:2048 -keyout ./certs/key.tmp.pem -out ${ certificate } -days 365 -nodes -subj "/C=US/ST=Foo/L=Bar/O=Baz/CN=localhost"`,
execOptions
);
execSync( `openssl rsa -in ./certs/key.tmp.pem -out ${ key }`, execOptions );
execSync( 'rm ./certs/key.tmp.pem', execOptions );
} catch ( error ) {
@Davisonpro
Davisonpro / game.html
Created January 28, 2019 19:57
Game starter
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>My first three.js app</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
</head>
@Davisonpro
Davisonpro / game.html
Created January 28, 2019 19:57
Game starter
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>My first three.js app</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
</head>
@Davisonpro
Davisonpro / game.html
Last active January 28, 2019 19:58
Game starter
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>My first three.js app</title>
<style>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
</head>