-
When you are coding you are doing two things
- Telling the machine to do a certain task for you
- Telling others who might look at your code that this is what you are intending to do
- We always focus on the 1st, not 2nd. IMO the point 2 is far more important than 1
-
Don't make your code complier friendly, make it human-friendly.
-
Everyone should be able to read your code like they are reading simple English.
-
Your code can be self-documented or you can add more documents in the form of comments and guides but more importantly, the code should tell a story. The reader should know where to start, how the move forward and where it ends.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var Extract = require('extract-text-webpack-plugin'); | |
var AssetsPlugin = require('assets-webpack-plugin'); | |
var CompressionPlugin = require('compression-webpack-plugin'); | |
var webpack = require('webpack'); | |
var DashboardPlugin = require('webpack-dashboard/plugin'); | |
var PROD = process.env.NODE_ENV === 'production'; | |
var DEV = !PROD; | |
var COMPRESS_FILES = process.env.COMPRESS_FILES === 'no'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"main": "index.js", | |
"scripts": { | |
"start": "webpack-dashboard -p 3001 webpack-dev-server --progress --inline", | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"build": "webpack", | |
}, | |
"dependencies": { | |
"classnames": "^2.2.5", | |
"css-loader": "^0.23.1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<title>Window On Load</title> | |
</head> | |
<body> | |
<h1>Window on load</h1> | |
</body> | |
<script type="text/javascript" charset="utf-8"> | |
var helloWorld = function (){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
margin: 3em 0; | |
padding: 0; | |
background-color: #315481; | |
background-image: -webkit-linear-gradient(top, #315481, #918e82 100%); | |
background-image: -moz-linear-gradient(top, #315481, #918e82 100%); | |
background-image: -o-linear-gradient(top, #315481, #918e82 100%); | |
background-image: linear-gradient(to bottom, #315481, #918e82 100%); | |
color: #333; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
yum remove ruby | |
yum install -y git-core curl make bzip2 gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel libxslt-devel sqlite sqlite-devel openssl openssl-devel | |
yum install -y nodejs | |
echo "adding rvm key" |
NewerOlder