Skip to content

Instantly share code, notes, and snippets.

View abruzzi's full-sized avatar
⌨️
Writing a React book - React Anti-Patterns

Juntao Qiu abruzzi

⌨️
Writing a React book - React Anti-Patterns
View GitHub Profile
@abruzzi
abruzzi / clean_code.md
Created September 12, 2021 00:22 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@abruzzi
abruzzi / .block
Created May 21, 2019 23:26 — forked from mbostock/.block
Stacked Radial Area
license: gpl-3.0
@abruzzi
abruzzi / reduxSelectorPattern.md
Created January 31, 2018 03:02 — forked from abhiaiyer91/reduxSelectorPattern.md
Redux Selector Pattern

Redux Selector Pattern

Imagine we have a reducer to control a list of items:

function listOfItems(state: Array<Object> = [], action: Object = {}): Array<Object> {
  switch(action.type) {
    case 'SHOW_ALL_ITEMS':
      return action.data.items
    default:
@abruzzi
abruzzi / sigma.fruchterman.js
Created May 25, 2017 07:47 — forked from sheymann/sigma.fruchterman.js
Fruchterman-Reingold layout plugin for Sigma.js with automatic cooling and stopping condition.
/**
* Linkurious 2012, all rights reserved.
* Sébastien Heymann <seb@linkurio.us>,
* Romain Yon <romain@linkurio.us>
*
* Please use http://jsbeautifier.org/ and indent with 2 spaces.
*
* Lib docs:
* http://twitter.github.com/bootstrap/
* http://docs.jquery.com/
@abruzzi
abruzzi / BankAccount.java
Created January 3, 2017 06:39 — forked from kt3k/BankAccount.java
BankAccount DCI example in Java
package org.kt3k.bankaccount;
public class BankAccount {
private String id;
private Integer balance;
public BankAccount(String id, Integer balance) {
this.id = id;
this.balance = balance;
@abruzzi
abruzzi / Doxyfile
Created December 6, 2016 10:57 — forked from atneik/Doxyfile
Ideal Doxyfile
# Doxyfile 1.7.5.1
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
@abruzzi
abruzzi / gist:7b75f60f82584d3405e6e5937918bc83
Created May 5, 2016 12:07 — forked from rnorth/gist:2031652
Cookie-based authentication with nginx
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
@abruzzi
abruzzi / build.gradle
Created December 19, 2015 07:04
Findbugs and PMD with Android Gradle Plugin
//Thanks to https://github.com/stephanenicolas/Quality-Tools-for-Android/blob/master/build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
@abruzzi
abruzzi / gulpfile.js
Created November 9, 2015 01:46 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@abruzzi
abruzzi / gist:c77d807a3f2578b3e000
Created October 19, 2015 00:56 — forked from afair/gist:3803895
PostgreSQL and Pgpool Architecture

Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer

Thanks for stopping by!

PostgreSQL and Pgpool Architecture