Skip to content

Instantly share code, notes, and snippets.

View straybro's full-sized avatar
🐢
418 I'm a teapot

straybro straybro

🐢
418 I'm a teapot
View GitHub Profile

Smalltalk Best Practice Patterns in Ruby

1 – INTRODUCTION

  • We aren’t always good at guessing where responsibilities should go. Coding is where our design guesses are tested. Being prepared to be flexible about making design changes during coding results in programs that get better and better over time.

  • If you’re programming along, doing nicely, and all of a sudden your program gets balky, makes things hard for you, it’s talking. It’s telling you there is something important missing.

  • Some of the biggest improvements come from figuring out how to eliminate:

  • Duplicate code (even little bits of it)
@straybro
straybro / sandibooks.txt
Created March 4, 2020 00:38 — forked from jonathankwok/sandibooks.txt
sandi's recommended references
(I've amended it to use Amazon.ca)
Things to Read:
Refactoring
Martin Fowler: Refactoring, Improving the Design of Existing Code
https://www.amazon.ca/Refactoring-Improving-Existing-Addison-Wesley-Technology-ebook/dp/B007WTFWJ6
Jay Fields: Refactoring, Ruby Edition
https://www.amazon.ca/Refactoring-Ruby-Addison-Wesley-Professional-ebook/dp/B002TIOYWG/
@straybro
straybro / lodash_groupBy.js
Created October 22, 2018 16:13
Vanilla JS
function getUniqueValuesOfKey(array, key){
return array.reduce(function(carry, item){
if(item[key] && !~carry.indexOf(item[key])) carry.push(item[key]);
return carry;
}, []);
}
@straybro
straybro / settings.json
Created October 18, 2018 10:17
VSCode user defined config
// Place your settings in this file to overwrite the default settings
{
"window.zoomLevel": 1,
"editor.tabSize": 2,
"workbench.colorTheme": "Visual Studio Light",
"editor.fontFamily": "Consolas",
"javascript.validate.enable": false,
"flow.useNPMPackagedFlow": true,
"editor.formatOnSave": true,
"prettier.singleQuote": true,
@straybro
straybro / postcss-breakpoint-debug.html
Last active October 18, 2018 08:30
PostCSS breakpoint debug
<style>
.breakpoint-display {
position: fixed;
bottom: 10%;
/*width: 100%;*/
width: 100vw;
text-align: left;
background: rgba(255, 0, 0, .6);
font-size: normal;
padding: 10px 30px;
<?php
/*
desc=some \n
desc\n
\n\n\n
key=some key \n
*/
if(!empty($legacyArticle->description)){