Skip to content

Instantly share code, notes, and snippets.

@indreklasn
indreklasn / package.json
Last active October 29, 2017 19:50
scripts for webpack-dashboard package.json
"scripts": {
"build": "webpack --progress",
"start": "webpack-dashboard -- webpack-dev-server -d --hot --config webpack.config.js --watch",
"production": "NODE_ENV=production webpack -p"
},
@indreklasn
indreklasn / vue.sh
Last active October 29, 2017 20:18
installing vue-cli
npm i -g vue-cli && vue init webpack vue-webpack-dashboard && cd vue-webpack-dashboard && npm i --save-dev webpack-dashboard
@indreklasn
indreklasn / gruntfile.js
Created October 31, 2017 17:51
webpack from scratch grunt demo
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks
grunt.initConfig({
sass: {
options: {
sourceMap: true
},
dist: {
files: {
'main.css': 'main.scss'
@indreklasn
indreklasn / gulpfile.js
Created October 31, 2017 17:52
gulpfile demo webpack form scratch
var gulp = require('gulp');
var sass = require('gulp-sass');
gulp.task('styles', function() {
gulp.src('sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css/'));
});
@indreklasn
indreklasn / install.sh
Last active November 10, 2017 06:44
init our node project, install next, react, react-dom, making /pages dir
mkdir next-react-ssr && cd next-react-ssr && npm init -y && npm install --save react react-dom next && mkdir pages
@indreklasn
indreklasn / createIndex.sh
Created November 2, 2017 21:25
create index file in /pages for next.js
touch pages/index.js
@indreklasn
indreklasn / inlineStyles.js
Last active November 7, 2017 21:21
demonstration of inline styles
const textStyles = {
color: white,
backgroundColor: black
}
<p style={textStyles}>inline style!</p>
@indreklasn
indreklasn / domNode.html
Created November 7, 2017 21:23
rendered style DOM Node
<p style="color: white; backgrond-color: black;">inline style!</p>
@indreklasn
indreklasn / css-in-js.js
Last active November 7, 2017 21:37
css-in-js example
// CSS-in-JS aphrodite example
import { StyleSheet, css } from 'aphrodite';
const styles = StyleSheet.create({
text: {
backgroundColor: 'black',
color: 'white',
},
});
@indreklasn
indreklasn / css-in-js.html
Last active November 7, 2017 21:40
css-in-js example
<style>
.hash136s21 {
background-color: black;
color: white;
}
</style>
<p class="hash136s21">Hello CSS-in-JS</p>