Skip to content

Instantly share code, notes, and snippets.

View hackvan's full-sized avatar

Diego Camacho hackvan

View GitHub Profile
@sulaya86
sulaya86 / deduplicate_products.py
Last active August 30, 2021 20:18
Remove extra blank spaces in a column and removes duplicated rows
# The Problem: Marketing Team requires to crosscheck the list of products available
# in all the websites of the Company
# Input: A Excel File that contains "Model" and "Item Path" columns
# Requirements: Models are duplicated, Remove the duplicated models and keep the Item Path
# The problem: The cells in the "Model" columns contains extra spaces which makes all the models be unique
# even if they are not
# This script will remove extra spaces, remove the cells duplicated by keeping the first item found
# author: Soraya Ruiz
# date of creation: 27-08-2021
# Clean the database
DROP TABLE IF EXISTS _orders CASCADE;
DROP TABLE IF EXISTS _users CASCADE;
DROP TABLE IF EXISTS orders CASCADE;
DROP TABLE IF EXISTS users CASCADE;
# Build the database (for hard deletion)
CREATE TABLE users (
id integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
name text NOT NULL
defmodule Super.RepoTest do
use Super.DataCase, async: true
require Logger
@skipped_schemas [UserService.User]
defp tenant_schemas do
{:ok, mods} = :application.get_key(:super, :modules)
Enum.map(mods, fn mod ->
@cgrothaus
cgrothaus / replicated_con_cache.ex
Last active December 13, 2023 09:22
A replicated cache in 60 lines using ConCache and Phoenix PubSub
defmodule MyApp.ReplicatedConCache do
@moduledoc """
Utility to replicate local ConCache operations via Phoenix.PubSub.
Only those ConCache functions that we need are replicated.
Prerequisites:
- for all relevant cache ids, there is a ConCache instance running on
each node connected to the PubSub system
- these ConCache instances are all configured same (TTL etc.)
@neodevelop
neodevelop / descubre_elixir_y_phoenix.livemd
Created October 22, 2025 18:11
🧠 Descubre por qué tantos desarrolladores se están enamorando de Elixir y Phoenix

🧠 Descubre por qué tantos desarrolladores se están enamorando de Elixir y Phoenix

Mix.install([
  {:kino, "~> 0.13"},
  {:phoenix, "~> 1.7"},
  {:phoenix_live_view, "~> 0.20"},
  {:plug_cowboy, "~> 2.7"}