Skip to content

Instantly share code, notes, and snippets.

View killerchip's full-sized avatar

Costas Ioannou killerchip

  • Morrow Digital
  • Larissa, Greece
View GitHub Profile
@killerchip
killerchip / margins-paddings.md
Last active November 26, 2017 18:30
Udacity Android Basics / Part 2 - scratchpad notes

Margins and Paddings

Paddings

Paddings are always applied by the view itself.

On all four sides

android:padding = "8dp"
@killerchip
killerchip / udacity-android-basics-lesson4.md
Last active December 3, 2017 17:41
Udacity: Android Basics course. Lesson 4 scratchpad notes

Android Basics Udacity Course / Lesson 4 notes

Preparing to work with Android

From Design to Code

@killerchip
killerchip / js-tip-missing-prop-and-default-val.md
Last active December 31, 2017 18:04
Javascript tip: Safely assign an object property and provide fallback value if missing.

Safe object property assignment and fallback value

You can safely assign object properties to variables, protecting your operation from exceptions. In case the value is falsely you can assign a default value.

let sourceObject = {
  prop1: "hello world",
  prop2: {
 prop21: 3,
@killerchip
killerchip / killerchip-gist-toc.md
Last active January 1, 2018 07:00
Killerchip Gist... coding notes, tips, cheats, guides, code snippets and tutorial articles
@killerchip
killerchip / general-cheat-law-of-demeter.md
Last active December 31, 2017 17:39
Cheatseat on implementing/checking the Law of Demeter in designing classes and their interaction.

Law of Demeter

The Law of Demeter for functions requires that a method m of an object O may only invoke the methods of the following kinds of objects.

  1. O itself
  2. m's parameters
  3. Any objects created/instantiated within m
  4. O's direct component objects
  5. A global variable, accessible by O, in the scope of m
@killerchip
killerchip / killerchip-general-programming-toc.md
Last active December 31, 2017 17:38
General programming... notes, tips, cheats, guides, code snippets and tutorial articles

Killerchip's General Programming Notes

General programming... notes, tips, cheats, guides, code snippets and tutorial articles.

Table of Contents

@killerchip
killerchip / ts-tip-model-class-creation.md
Last active November 29, 2023 08:52
Typescript Tip: Recommended way of creating classes that model the data of your Typescript app.

Creating model classes in Typescript

Tip: Recommended way of creating classes that model the data of your Typescript app.

Creating simple classes

Create a simple class with a small set (0-3) of parameters in the constructor.

  • Define the properties directly in the parameter of the constructor.
  • Define optional parameters by defining default values
@killerchip
killerchip / killerchip-ts-toc.md
Last active April 29, 2018 04:08
Typescript... coding notes, tips, cheats, guides, code snippets and tutorial articles
@killerchip
killerchip / angular-guide-starting-project.md
Created December 31, 2017 17:55
Angular Guide: Planning and Starting an Angular project

Starting an Angular Project Guidelines

Here follows a draft guide/checklist on how to get started with an angular project.

  • PAGE BUILDING
    • Identify and scetch Components tree.
      • Identify components and subcomponents
      • Make list of items components themselves.
    • Identify the model and model classes.
  • tip: Try to isolate data structures from components. Think... "can the component be replaced without affecting data"?
@killerchip
killerchip / killerchip-angular-toc.md
Last active January 21, 2018 21:02
Angular... coding notes, tips, cheats, guides, code snippets and tutorial articles