Skip to content

Instantly share code, notes, and snippets.

Alex Loukissas aloukissas

  • Los Angeles, CA
Block or report user

Report or block aloukissas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View lookup_country.ex
iex(1)> Geolix.lookup("45.50.161.38", [as: :raw, where: :country])
%{
continent: %{
code: "NA",
geoname_id: 6255149,
names: %{
de: "Nordamerika",
en: "North America",
es: "Norteamérica",
fr: "Amérique du Nord",
View lookup_options.ex
iex(1)> Geolix.lookup("45.50.161.38", [as: :raw, where: :country])
%{
continent: %{
code: "NA",
geoname_id: 6255149,
names: %{
de: "Nordamerika",
en: "North America",
es: "Norteamérica",
fr: "Amérique du Nord",
View lookup_simple.ex
iex(1)> Geolix.lookup("45.50.161.38")
%{
city: %Geolix.Adapter.MMDB2.Result.City{
city: %Geolix.Adapter.MMDB2.Record.City{
geoname_id: 5368361,
name: "Los Angeles",
names: %{
de: "Los Angeles",
en: "Los Angeles",
es: "Los Ángeles",
View config.exs
config :geolix, :databases, [
%{
id: :city,
adapter: Geolix.Adapter.MMDB2,
source: "https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"
},
%{
id: :country,
adapter: Geolix.Adapter.MMDB2,
source: "https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz"
View email_test.exs
defmodule Acme.EmailTest do
use ExUnit.Case
alias Acme.Models.User
test "welcome email" do
user = %User{first_name: "John", email: "person@example.com"}
email = Acme.Email.welcome_user(user)
assert email.to == user
View send_email.ex
Acme.Models.find_by_email("roadrunner@me.com")
|> Acme.Tasks.Email.welcome_user()
|> Acme.Mailer.deliver_now()
View email_check.ex
defmodule Acme.Tasks.Email do
import Bamboo.Email
alias Acme.Models.User
def welcome_user(%User{first_name: first_name, email: email, state: "ACTIVE"})
when first_name != "" do
new_email(
to: {first_name, email},
from: {"Acme Products", "hello@acme.com"},
subject: "Welcome to Acme Products",
View email_basic.ex
defmodule Acme.Tasks.Email do
import Bamboo.Email
alias Acme.Models.User
def welcome_user(%User{first_name: first_name, email: email}) do
new_email(
to: {first_name, email},
from: {"Acme Products", "hello@acme.com"},
subject: "Welcome to Acme Products",
text_body: """
View ShareDemo.js
include React from "react";
include { Platform, Share, Text, View } from "react-native";
class ShareDemo extends React.Component {
handleShare = async () => {
try {
const message = "Hey, check out this awesome new app!";
const url = "https://chck.app";
const isIos = Platform.OS === "ios";
let content = {};
View LinkingPhone.js
import React from "react";
import { Linking, Text, View } from "react-native";
class LinkingDemoModal extends React.Component {
handleOpenUrl = url => {
Linking.openURL(url);
}
render() {
return (
You can’t perform that action at this time.