Skip to content

Instantly share code, notes, and snippets.

@kakobotasso
kakobotasso / Retrofit
Created March 6, 2017 21:27
Exemplo de uso da lib Retrofit
//URL
/usuarios/rafa@gmail
// JAVA CLASS
public class Usuario{
String nome
String email
// TODOS OS ATRIBUTOS QUE VEM NO JSON
}
@kakobotasso
kakobotasso / ProfileImageView.swift
Created March 11, 2017 20:18
Como deixar imagens redondas com Swift alterando o Storyboard
import UIKit
@IBDesignable class ProfileImageView: UIImageView {
@IBInspectable var cornerRadius: CGFloat = 0 {
didSet{
self.layer.cornerRadius = cornerRadius
}
}
@IBInspectable var borderWidth: CGFloat = 0 {
@kakobotasso
kakobotasso / server.js
Created August 19, 2017 13:18
FIAP Arduino Liga/Desliga LED
var express = require('express');
var five = require('johnny-five');
var app = express();
var board = new five.Board({port:"COM3"});
var relay;
board.on("ready", function(){
console.log("Arduino conectado");
relay = new five.Relay(13);
@kakobotasso
kakobotasso / index.html
Created August 19, 2017 13:44
Front FIAP Arduino
<html ng-app="fiapIoT">
<head>
<meta charset="UTF-8">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script>
<script src="main.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<title>FIAP - IoT</title>
</head>
<body ng-controller="MainCtrl">
@kakobotasso
kakobotasso / MainPage.xaml
Created May 14, 2019 03:51
MainPage from FireEvents
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:FireEvents" x:Class="FireEvents.MainPage">
<StackLayout>
<Button
Text="Click button 01"
Clicked="OnButton01Clicked" />
<Button
Text="Click button 02"
Clicked="OnButton02Clicked" />
@kakobotasso
kakobotasso / MainPage.xaml.cs
Created May 14, 2019 03:53
MainPage code behind FireEvents
using System;
namespace FireEvents
{
[DesignTimeVisible(true)]
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
@kakobotasso
kakobotasso / IEventTracker.cs
Created May 14, 2019 04:00
IEventTracker FireEvents
using System;
using System.Collections.Generic;
namespace FireEvents
{
public interface IEventTracker
{
void SendEvent(string eventId);
void SendEvent(string eventId, string paramName, string value);
void SendEvent(string eventId, IDictionary<string, string> parameters);
@kakobotasso
kakobotasso / EventTrackerDroid.cs
Created May 14, 2019 04:09
IEventTracker implementation FireEvents
using System;
using System.Collections.Generic;
using Android.OS;
using Firebase.Analytics;
using FireEvents;
using FireEvents.Droid;
using Xamarin.Forms;
[assembly: Dependency(typeof(EventTrackerDroid))]
namespace FireEvents.Droid
@kakobotasso
kakobotasso / FireEvents.Android.csproj
Created May 14, 2019 04:18
FireEvents.Android.csproj FireEvents
<ItemGroup>
<GoogleServicesJson Include="google-services.json" />
</ItemGroup>
@kakobotasso
kakobotasso / MainPage.xaml.cs
Created May 14, 2019 04:23
MainPage.xaml.cs completed FireEvents
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace FireEvents
{