Skip to content

Instantly share code, notes, and snippets.

View aldidas's full-sized avatar

Aldi Daswanto aldidas

View GitHub Profile
@aldidas
aldidas / main.js
Created December 10, 2016 00:42
main.js for lamp electron app
const electron = require('electron')
const http = require('http')
const initServer = require('./js/server')
// Module to control application life.
const app = electron.app
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow
@aldidas
aldidas / renderer.js
Last active December 10, 2016 01:43
Rendered for the lamp app
const io = require('socket.io-client')
const CONSTANTS = require('./const')
const socket = io.connect('http://localhost:' + CONSTANTS.PORT)
const theLight = document.getElementById('the-light')
// log the message, check if socket.io server is connected
socket.on('init', (data) => {
console.log(data.message)
})
@aldidas
aldidas / index.html
Created December 10, 2016 01:00
main UI lamp app
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Lamp</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="the-light"></div>
@aldidas
aldidas / style.css
Last active December 10, 2016 02:56
Lamp app style.css
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background: black;
}
body {
display: flex;
/**
$posted_data = PHP array consisting posted data from the form :
$posted_data = array(
'message' => '',
'fullname' => '',
'company' => '',
'position' => '',
'telephone' => '',
'email' => ''
);