Skip to content

Instantly share code, notes, and snippets.

View mmaia's full-sized avatar
🎯
Focusing

Marcos mmaia

🎯
Focusing
  • Bitvavo
  • Netherlands
View GitHub Profile
@mmaia
mmaia / getting-started-strongloop.md
Last active July 8, 2016 15:55
StrongLoop Quick Notes

StrongLoop Quick Start Notes

"Atwood's Law: any application that can be written in JavaScript will eventually be written in JavaScript." -- Jeff Atwood

This are my notes to quick start an application using StrongLoop.

There's a well documented quick start guide at StrongLoop site here: https://docs.strongloop.com/display/public/LB/Getting+started+with+LoopBack

There's a very nice set of examples in the official StrongLoop github repository:

@mmaia
mmaia / getting-started-ionic.md
Created June 17, 2016 21:03
Getting started ionic 1.x

Very quick start with Ionic, my personal notes.

This is my very quick start guide to ionic development, it contains my notes to quickly became up to speed with an app ready to start coding and basic ionic commands and issues for reference.

Install Android development Environment:

Install ionic & cordova:

  • npm install ionic -g
  • npm install cordova -g
@mmaia
mmaia / getting-started-angular2.md
Created July 30, 2016 09:56
Angular 2 notes - getting started
@mmaia
mmaia / ConcurrentMapIteration.java
Created October 13, 2017 18:46
Proves that 2 threads using each one it's own iterator will not cause ConcurrentModificationException while accessing and modifying a ConcurrentHasMap in java
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ConcurrentMapIteration
{
private final Map<String, String> map = new ConcurrentHashMap<String, String>();
@mmaia
mmaia / Consensus.md
Last active January 10, 2018 07:35
Notes about consensus algorithms, consensus implementations and approaches

Consensus

A fundamental problem and one of the most important abstractions for distributed and multi-agent systems is to achieve overall system reliability in the presence of a number of faulty processes, consensus. This often requires processes to agree on some data value that is needed during computation.

Consensus algorithm requires at least a mojority of nodes to be functioning correctly so that majority can for a quorum. There's a termination property in consensus that is subject to the assumption that fewer than half of the nodes are crashed or unreachable, however, most implementations of consensus ensure that the safety properties - agreement, integrity and validity - are always met, even if the majority of nodes fail or there is a severe network problem, meaning that in case of a large scale outage can stop teh system from being able to process requests, but it cannot corrupt the consensus system by causing it to make invalid decisions.

Putting the aforementioned paragraph in example it means w

@mmaia
mmaia / Functional_Java.md
Last active January 16, 2018 13:22
Functional java notes

Simple map and flatMap example

reference page

// define a function that maps String to Long
Function<String, Long> toLong = Long::parseLong; 

//aplying the function to the possible string
Optional someString = Optional.of("12L");
@mmaia
mmaia / TestJavaStrongEnc.md
Last active January 17, 2018 11:33
Tests if java runtime has strong encryption packages installed

Due to legal reasons the default jdk from oracle does not have strong encryption enabled by default the Java Cryptography Extension (JCE) Unlimited Strength needs to be downloaded and configured.

The following java code can be used to test if your jvm has it configured:

import javax.crypto.Cipher;
import java.security.NoSuchAlgorithmException;
@mmaia
mmaia / zshcustom_file.zsh
Last active May 31, 2022 07:47
my generic zsh custom file
#!/bin/zsh
echo "--------------- Loading mmaia.zsh functions----------------"
function idea() {
find ~/.local/share/JetBrains/Toolbox/apps/IDEA-U -name "idea.sh" -exec chmod +x {} \; -exec {} $1 \; >/dev/null 2>&1 &
}
function reload() {
source ~/.zshrc
}
@mmaia
mmaia / local-config.yml
Last active March 18, 2018 10:13
ansible-playbook to configure local workstation when Ubuntu linux is installed(tested with 16.04 LTS desktop). Run with: `ansible-playbook local-config.yml --extra-vars "ansible_sudo_pass=$SUDO_PWD`"
---
- name: configure local machine sudo
hosts: localhost
sudo: yes
tasks:
- name: ensure up to date O.S
command: apt -y update
- name: install base packages