This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defp find_in_combinations(combinations, element) do | |
Enum.reduce(combinations, [], fn(c, acc) -> | |
# A dynamic way to access c.element (Eg. c.engine) | |
if Map.get(c, element) do | |
acc ++ [Map.get(c, element)] | |
else | |
acc | |
end | |
end) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def extract(changeset) do | |
file_name = changeset.data.name | |
data = File.read!("#{@data_folder}/pages/#{file_name}") | |
case String.split(data, ~r/\n-{3,}\n/, parts: 2) do | |
[""] -> | |
%{frontmatter: nil, content: nil} | |
[frontmatter, content] -> | |
%{ | |
frontmatter: parse_yaml(frontmatter), | |
content: content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows 7 All Online/Offline [Retail-MAK] Activation Keys | |
================================================================================= | |
. Run "Command Prompt" as Administrator | |
. slmgr.vbs -ipk Product Key | |
. slui4 | |
================================================================================= | |
Windows 7 Ultimate Retail Phone Activation Keys | |
RHTBY-VWY6D-QJRJ9-JGQ3X-Q2289 | |
V77DJ-CT8WB-Y3GXT-X3FBP-6F987 | |
JC7BV-94FD2-D86PH-XRMHR-BXKDG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule AI.ImageGen do | |
image_prompt_generator_prompt = """ | |
[INST] <<SYS>> | |
You are an expert recipe image designer. | |
Your job is to generate a prompt for DALL-E image generator to generate a cover image for an E-Commerce product based on a user's given question. | |
Step 1: Extract the key information from the question. | |
Step 2: Generate a prompt for DALL-E image generator to generate a cover image for an E-Commerce product based on the extracted information. | |
GUIDELINES: | |
1. The images should be free of text or artifacts and must be stylish, modern, futuristic and vivid. | |
2. Do not create any hues in the produced image. Go with a black background if you are unsure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule NestedWeb.FormLive do | |
use NestedWeb, :live_view | |
require Logger | |
defmodule Form do | |
use Ecto.Schema | |
import Ecto.Changeset | |
embedded_schema do | |
field :name, :string |
OlderNewer