Skip to content

Instantly share code, notes, and snippets.

View TeijiW's full-sized avatar
👍
Focusing

Alessandro Teiji TeijiW

👍
Focusing
  • Finbits
  • Cuiabá, MT
  • 14:57 (UTC -04:00)
View GitHub Profile

Testes com dados

Mix.install([
  {:kino_db, "~> 0.2.10"},
  {:explorer, "~> 0.9.0"},
  {:req, "~> 0.4.8"},
  {:kino_explorer, "~> 0.1.18"},
  {:nx, "~> 0.5"},
  {:csv, "~> 3.2"},
defmodule ProjectWeb.UserSessionController do
use ProjectWeb, :controller
alias Project.Accounts
alias ProjectWeb.UserAuth
def create(
conn,
%{
"user" => %{"email" => email, "code" => code} = user_params
defmodule ProjectWeb.UserSessionLive do
use ProjectWeb, :live_view
alias Project.Accounts
def mount(_params, _session, socket) do
{:ok,
assign(socket,
email_input_error: nil,
email: nil
@TeijiW
TeijiW / user_session_live.html.leex
Last active June 8, 2021 12:39
Codes for Medium article
<%= if !@email do %>
<%= form_for :user, "#", [phx_submit: :login]\, fn f -> %>
<%= label f, :email, "E-mail" %>
<%= email_input f, :email, required: true %>
<%= if @email_input_error do %>
<span> <%= @email_input_error %> </span>
<% end %>
<%= submit "Continue" %>
<% end %>
@TeijiW
TeijiW / TicketGate.java
Created September 4, 2019 07:05
A search in a Database
package ticketgate;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import javax.swing.JOptionPane;
@TeijiW
TeijiW / Open URL in default browser
Created March 8, 2018 07:33 — forked from pirafrank/Open URL in default browser
Open an URL in the default browser. Python snippet.
#!/usr/bin/python
import webbrowser
webpage = 'http://www.google.com'
webbrowser.open_new_tab(webpage)