Skip to content

Instantly share code, notes, and snippets.

@aloukissas
aloukissas / clippy.svg
Created March 8, 2023 20:31
clippy-ftw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Line # Hits Time Per Hit % Time Line Contents
==============================================================
[...]
51 7750 1967208.0 253.8 90.8 cor = np.corrcoef(data1, data2)
function maybeShowAlert(event) {
event.preventDefault();
if (maybeShowAlert.shown === undefined) {
alert("Hello!");
maybeShowAlert.shown = true;
}
}
document.addEventListener("mouseout", maybeShowAlert, false);
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
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
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
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
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
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: %{
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