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 simple_mult_int.py
Python 3.7.6 (default, Jan 2 2020, 08:35:56)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 165 * 1940
320100
View dime_loop.py
Python 3.7.6 (default, Jan 2 2020, 08:35:56)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 0
>>> for x in range (0, 10000):
... a += 0.1
...
>>> a
1000.0000000001588
View simple_mult.py
Python 3.7.6 (default, Jan 2 2020, 08:35:56)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 165 * 19.40
3200.9999999999995
View simple_addition.py
Python 3.7.6 (default, Jan 2 2020, 08:35:56)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 0.1 + 0.2
0.30000000000000004
View simple_addition.py
Python 3.7.6 (default, Jan 2 2020, 08:35:56)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 0.1 + 0.2
0.30000000000000004
View create_subscription_with_v2.ex
def create_subscription(email, plan_id, payment_method_id) do
with {:user_lookup, %User{customer_id: nil, name: name} = user} <-
{:user_lookup, Repo.get_by(User, email: email)},
{:customer_creation, {:ok, %Stripe.Customer{id: customer_id}}} <-
{:customer_creation,
Stripe.Customer.create(%{
name: name,
email: email,
payment_method: payment_method_id,
invoice_settings: %{
View create_subscription_with.ex
def create_subscription(email, plan_id, payment_method_id) do
with %User{customer_id: nil, name: name} = user <-
Repo.get_by(User, email: email),
{:ok, %Stripe.Customer{id: customer_id}} <-
Stripe.Customer.create(%{
name: name,
email: email,
payment_method: payment_method_id,
invoice_settings: %{
default_payment_method: payment_method_id
View create_subscription_nested.ex
def create_subscription(email, plan_id, payment_method_id) do
case Repo.get_by(User, email: email) do
%User{customer_id: nil, name: name} = user ->
params = %{
name: name,
email: email,
payment_method: payment_method_id,
invoice_settings: %{
default_payment_method: payment_method_id
}
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",
You can’t perform that action at this time.