Skip to content

Instantly share code, notes, and snippets.

View skiabox's full-sized avatar

Stavros Kefaleas skiabox

View GitHub Profile
@skiabox
skiabox / package
Created July 29, 2017 13:32
package.json
{
"name": "WebpackTypescript1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack-dev-server",
"build:prod": "webpack -p"
},
@skiabox
skiabox / app.ts
Created July 29, 2017 13:29
app.ts
import '../css/main.css';
import '../css/input-elements.css';
import {secretButton, secretParagraph } from './dom-loader';
let showSecret: boolean = false;
secretButton!.addEventListener('click', toggleSecretState);
updateSecretParagraph();
@skiabox
skiabox / dom-loader.ts
Created July 29, 2017 13:27
dom-loader.ts
export const secretButton: Element | null = document.querySelector('#secret-button');
export const secretParagraph: Element | null = document.querySelector('#secret-paragraph');
@skiabox
skiabox / webpack.config.js
Last active September 18, 2017 00:00
webpack.config.js
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: './src/js/app.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/dist'
@skiabox
skiabox / tsconfig
Last active July 29, 2017 13:21
tsconfig.json
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation: */
"allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
@skiabox
skiabox / index.html
Last active September 17, 2017 18:23
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Webpack 3 with Typescript</title>
</head>
<body>
@skiabox
skiabox / input-elements.css
Created July 29, 2017 13:01
input-elements.css
button {
border: 1px solid black;
background-color: white;
padding: 8px;
font: inherit;
cursor: pointer;
outline: none;
}
button:hover {
@skiabox
skiabox / main.css
Created July 29, 2017 12:56
Css File 1
body {
font-family: Helvetica, Arial, sans-serif;
text-align: center;
}
h1 {
font-size: 28px;
margin: 20px;
}
@skiabox
skiabox / Tiger.java
Created October 13, 2016 22:55
Tiger class
package com.skiabox.java_apps2;
/**
* Created by administrator on 10/10/2016.
*/
public class Tiger extends Feline{
@Override
public void makeNoise() {
System.out.println("The tiger is growling");
@skiabox
skiabox / Lion.java
Created October 13, 2016 22:54
Lion class
package com.skiabox.java_apps2;
/**
* Created by administrator on 09/10/2016.
*/
public class Lion extends Feline{
//Lion methods
@Override
public void makeNoise() {