Skip to content

Instantly share code, notes, and snippets.

View marclerodrigues's full-sized avatar

Marcle Rodrigues marclerodrigues

View GitHub Profile
This manifesto will guide me through my path as Developer.
@marclerodrigues
marclerodrigues / pegcar.rb
Last active March 12, 2017 03:52
Submission test for Pegcar
(1..100).map do |n|
n
"Pegcar" if remainder_zero?(n, 35)
"car" if remainder_zero?(n, 7)
"Peg" if remainder_zero?(n, 5)
end
def remainder_zero?(a, b)
a % b == 0
end
@marclerodrigues
marclerodrigues / webpack.config.js
Last active December 5, 2016 22:08
defining webpack entry point
const config = {
entry: 'path/to/your/application/entry/point.js';
};
module.exports = config;
@marclerodrigues
marclerodrigues / webpack.config.js
Last active December 5, 2016 22:07
multiple entry points with one single dependency three
const config = {
entry: [
'app/assets/javascripts/main.js',
'app/assets/javascripts/application.js'
];
};
module.exports = config;
@marclerodrigues
marclerodrigues / webpack.config.js
Created December 5, 2016 22:34
output webpack config example
const config = {
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
};
};
module.exports = config;
@marclerodrigues
marclerodrigues / webpack.config.js
Last active December 31, 2016 18:34
Webpack config
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: './assets/application.js',
output: { path: __dirname, filename: 'bundle.js' },
module: {
loaders: [
{
test: /.jsx?$/,
@marclerodrigues
marclerodrigues / hello.jsx
Last active December 31, 2016 18:53
Hello React Component
import React from 'react';
import ReactDOM from 'react-dom';
class Hello extends React.Component {
render() {
return <h1> Hello! </h1>
}
}
ReactDOM.render(<Hello />, document.getElementById('hello'));
import Hello from './components/hello.jsx';
@marclerodrigues
marclerodrigues / index.html
Created December 31, 2016 18:56
Index HTML
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello React</title>
</head>
<body>
<div id="hello"></div>
<script src="bundle.js"></script>
</body>
@marclerodrigues
marclerodrigues / Object Oriented Design by Sandi Metz Notes Part 1
Last active March 28, 2021 15:49
A Quick Overview of Object Oriented Design
# Chapter 1 - Object-Oriented Design
1. The Problem Design Solves
> It is the need for change that makes design matter.
2. Why Change is Hard
> Parts interact to product behavior (objects), the interaction is made through messages passed between them.
> Object-Oriented Design is about managing dependencies.
> OOD - Set of coding techniques to arrange dependencies so objects can tolerate change.