Skip to content

Instantly share code, notes, and snippets.

View giorgiofellipe's full-sized avatar
🏛️
Helping people build great business

Giorgio Fellipe giorgiofellipe

🏛️
Helping people build great business
View GitHub Profile
@giorgiofellipe
giorgiofellipe / PrinterProtocolAdapter.class
Created April 13, 2022 16:35
PrinterProtocolAdapter.class
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.datecs.api.printer;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
[
{
"id":"0",
"name":"Vida Ativa",
"email":"",
"imagesFolderName":"vida-ativa",
"products":[
{
"sku":"13",
"name":"Tênis New Balance 247 - Verde",
@giorgiofellipe
giorgiofellipe / awc-ecs-access-to-aws-efs.md
Created June 29, 2018 17:14 — forked from duluca/awc-ecs-access-to-aws-efs.md
Step-by-step Instructions to Setup an AWS ECS Cluster

Configuring AWS ECS to have access to AWS EFS

If you would like to persist data from your ECS containers, i.e. hosting databases like MySQL or MongoDB with Docker, you need to ensure that you can mount the data directory of the database in the container to volume that's not going to dissappear when your container or worse yet, the EC2 instance that hosts your containers, is restarted or scaled up or down for any reason.

Don't know how to create your own AWS ECS Cluster? Go here!

New Cluster

Sadly the EC2 provisioning process doesn't allow you to configure EFS during the initial config. After your create your cluster, follow the guide below.

New Task Definition for Web App

If you're using an Alpine-based Node server like duluca/minimal-node-web-server follow this guide:

@giorgiofellipe
giorgiofellipe / instructions.md
Last active July 31, 2020 08:55
How to deploy MEAN app to AWS EC2
  1. Generate a key pair
  2. Create an AWS EC2 Instance
  3. Edit Security Group network rules
  4. Add Elastic IP and associate it to EC2 Instance
  5. Install Node
  • sudo yum install gcc-c++ openssl-devel make
  • wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
  • close ssh connection or terminal
  • nvm install [version]
  • node --version
@giorgiofellipe
giorgiofellipe / text_format.js
Last active March 22, 2016 03:15
Text format
var yourString = "The quick brown fox jumps over the lazy dog"; //replace with your string.
var finalString = "";
var maxLength = 16 // maximum number of characters to extract
var count = 0;
var maxTries = ((yourString.length / maxLength) * 2);
while (yourString.length > maxLength) {
count++;
if (count > maxTries) {
break;
@giorgiofellipe
giorgiofellipe / workshop.md
Last active December 23, 2015 17:38
Ionic Workshop Guide

Projetos utilizados para demonstração ou construídos durante o workshop

Design Patterns

  • IIFE (Immediately-invoked Function Expression) - isolar escopo com o propósito de não misturar variáveis criadas globalmente
  • 'use strict' forçar o uso do JavaScript no modo restrito à versão EC5 ou superior (é ignorado pelas anteriores), não permitindo por exemplo: usar variáveis não declaradas

Preparando Ambiente

@giorgiofellipe
giorgiofellipe / Class.js
Created November 25, 2015 12:25
Simple JavaScript inheritance by John Resig - http://ejohn.org/blog/simple-javascript-inheritance/
/* Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* MIT Licensed.
*/
// Inspired by base2 and Prototype
(function(){
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
// The base Class implementation (does nothing)
this.Class = function(){};
angular.module('starter.controllers', [])
.controller('MapCtrl', function($scope, $ionicLoading) {
$scope.mapCreated = function(map) {
$scope.map = map;
};
var markersArray = [];
$scope.centerOnMe = function() {
@giorgiofellipe
giorgiofellipe / gist:4c275218bbe0d0ea546d
Created September 18, 2015 04:04
Guia - DEMO Ionic App
1. Copiar .json pra pasta www
2. Instalar angular-resource
2.1 bower install angular-resource
2.2 <script src="lib/angular-resource/angular-resource.min.js"></script> no index.html
2.3 criar module services
angular.module('starter.services', ['ngResource'])
.factory('musicList', function($resource) {
return $resource('music.json', {}, {
@giorgiofellipe
giorgiofellipe / music.json
Created September 18, 2015 03:51
JSON - Music List
[
{
"title":"The King of Limbs",
"songs":[
{
"title":"Bloom",
"length":"5:15"
},
{
"title":"Morning Mr Magpie",