Skip to content

Instantly share code, notes, and snippets.

Avatar

Luke Watts lukewatts

  • Affinity4
  • Galway, Ireland
View GitHub Profile
@lukewatts
lukewatts / laravel-homestead_error-report.txt
Created Dec 11, 2019
Composer self-update fails in Laravel/Homestead due to no proxy settings
View laravel-homestead_error-report.txt
==> homestead: Checking if box 'laravel/homestead' version '9.1.0' is up to date...
==> homestead: Clearing any previously set forwarded ports...
==> homestead: Clearing any previously set network interfaces...
==> homestead: Preparing network interfaces based on configuration...
homestead: Adapter 1: nat
homestead: Adapter 2: hostonly
==> homestead: Forwarding ports...
homestead: 80 (guest) => 8000 (host) (adapter 1)
homestead: 443 (guest) => 44300 (host) (adapter 1)
homestead: 3306 (guest) => 33060 (host) (adapter 1)
@lukewatts
lukewatts / .babelrc
Created Oct 17, 2018
Medium Article - Use JSX with any MV* framework - Code Snippets - 17 - .babelrc
View .babelrc
{
"plugins": [
[
"@babel/plugin-transform-react-jsx",
{
"pragma": "Reactbone.createElement"
}
]
]
}
@lukewatts
lukewatts / Reactbone.js
Created Oct 17, 2018
Medium Article - Use JSX with any MV* framework - Code Snippets - 16 - Reactbone.js
View Reactbone.js
import dom from 'jsx-render';
const Reactbone = {};
Reactbone.createElement = dom;
export class Component
{
view(el)
{
el.appendChild(this.render());
@lukewatts
lukewatts / index.js
Created Oct 17, 2018
Medium Article - Use JSX with any MV* framework - Code Snippets - 15 - Test Component with Reactbone
View index.js
import Reactbone, { Component } from './Reactbone';
class Test extends Component
{
constructor()
{
super();
this.view(document.getElementById('app'));
}
@lukewatts
lukewatts / index.js
Created Oct 17, 2018
Medium Article - Use JSX with any MV* framework - Code Snippets - 14 - Test Component with JSX
View index.js
class Test extends Component
{
constructor()
{
super();
this.view(document.getElementById('app'));
}
render()
{
@lukewatts
lukewatts / index.js
Created Oct 17, 2018
Medium Article - Use JSX with any MV* framework - Code Snippets - 13 - Test Component
View index.js
import dom from 'jsx-render';
class Component
{
view(el)
{
el.appendChild(this.render());
}
render()
@lukewatts
lukewatts / index.js
Created Oct 17, 2018
Medium Article - Use JSX with any MV* framework - Code Snippets - 12 - Base Component
View index.js
import dom from 'jsx-render';
class Component
{
view(el)
{
el.appendChild(this.render());
}
render()
@lukewatts
lukewatts / index.js
Created Oct 16, 2018
Medium Article - Use JSX with any MV* framework - Code Snippets - 11 - Testing jsx-render
View index.js
import dom from 'jsx-render';
class Test {
constructor()
{
var app = document.getElementById('app')
var htmlCreatedByJSXRender = dom('h1', {}, 'Test Class');
app.appendChild(htmlCreatedByJSXRender);
}
}
@lukewatts
lukewatts / index.html
Last active Oct 16, 2018
Code Revisions 1 Medium Article - Use JSX with any MV* framework - Code Snippets - 10 - HTML File
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="app"></div>
@lukewatts
lukewatts / package.json
Last active Oct 16, 2018
Code Revisions 1 Medium Article - Use JSX with any MV* framework - Code Snippets - 09 - Add webpack to scripts
View package.json
{
"scripts": {
"start": "webpack --watch"
},
"dependencies": { },
"devDependencies": { }
}