Skip to content

Instantly share code, notes, and snippets.

@aw3s0me
aw3s0me / clean_code.md
Created November 4, 2018 19:48 — 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

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// Enable component-scanning and auto-configuration with @SpringBootApplication Annotation
// It combines @Configuration + @ComponentScan + @EnableAutoConfiguration
@SpringBootApplication
public class FooApplication {
public static void main(String[] args) {
// Bootstrap the application
SpringApplication.run(FooApplication.class, args);
}
}
@aw3s0me
aw3s0me / introrx.md
Created June 21, 2017 08:01 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@aw3s0me
aw3s0me / The Technical Interview Cheat Sheet.md
Created June 6, 2017 10:13 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@aw3s0me
aw3s0me / ultimate-ut-cheat-sheet.md
Created September 18, 2016 12:21 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@aw3s0me
aw3s0me / advertisement.js
Created July 20, 2016 10:34
Parsing advertisement js
function parseAdvertisingData(buffer) {
var length, type, data, i = 0, advertisementData = {};
var bytes = new Uint8Array(buffer);
while (length !== 0) {
length = bytes[i] & 0xFF;
i++;
// decode type constants from https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile
@aw3s0me
aw3s0me / fixtures.md
Created June 10, 2016 20:49
Loading fixtures (mocks) in karma-mocha-chai
@aw3s0me
aw3s0me / bag.py
Created February 4, 2016 17:01 — forked from nutjob4life/bag.py
Example of making an RDF "Bag" with rdflib in Python
# encoding: utf-8
import rdflib
book = rdflib.URIRef(u'urn:isbn:978-3-16-148410-0')
bookType = rdflib.URIRef(u'urn:publishing:schema:book')
authorPredicate = rdflib.URIRef(u'http://purl.org/dc/terms/creator')
joyce = rdflib.URIRef(u'urn:foaf:registered-people:joyce')
kelly = rdflib.URIRef(u'http://twitter.org/nutjob4life')
mattmann = rdflib.URIRef(u'http://people.apache.org/mattmann')