Skip to content

Instantly share code, notes, and snippets.

View julianalucena's full-sized avatar

Juliana Lucena julianalucena

  • Incognia
  • Recife, Pernambuco, Brazil
View GitHub Profile
{
"evidence": {
"account_integrity": {...},
"addresses": [...],
"device_behavior_reputation": "allowed",
"device_fraud_reputation": "allowed",
"device_integrity": {
"emulator": false,
"from_official_store": true,
"gps_spoofing": false,
require 'faraday'
require 'json'
module Incognia
class Api
include Singleton
API_HOST = 'https://api.us.incognia.com/api/'.freeze
def register_login(installation_id:, account_id:)
@julianalucena
julianalucena / login_form.rb
Last active June 26, 2021 02:54 — forked from nataliaconde/login_form.rb
authentication logic
# login_form.rb
class LoginForm < BaseForm
attr_accessor :email, :password, :incognia_installation_id
validates :email, :password, presence: true
validate :device_risk
# Other validations...
def submit
return nil if invalid?
@julianalucena
julianalucena / sessions_controller.rb
Last active June 26, 2021 02:53 — forked from nataliaconde/sessions_controller.rb
Ruby controller/handler
# sessions_controller.rb
class SessionsController < ApplicationController
def create
@login_form = LoginForm.new(params)
if @user = @login_form.submit
sign_in @user
redirect_to @user, notice: "Welcome!"
else
render action: :new
@julianalucena
julianalucena / backbone-carousel.html
Created October 8, 2015 13:07 — forked from jjulian/backbone-carousel.html
A simple carousel implemented with a single Backbone view

Descrição de Projeto: encapsuladores

Projeto 1

Este projeto consiste na criação do encapsulador para a API REST do Mural do Redu.

O que é um encapsulador?

Encapsularoes (para APIs REST), também conhecidos como wrappers, são bibliotecas que abstraem detalhes de rede na comunicação com serviços terceiros.

Task

  • X should be removed (from UI)
  • should be passed between stories and states
  • should be rendered when creating
  • X should rerender when updating
  • should have story_id
  • should bind to dragstop

Story

<%= pjax_content_for :head_scripts_and_styles do %>
<%= lazy_load :js, javascript_path("myplugin.js"), jammit_path(:jammt_package) do %>
(function($){
var a = new Abc();
a.init();
})($);
<% end %>
<% end %>