Nosso canal no telegram: Vagas Dev
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
| Application.put_env(:sample, Example.Endpoint, | |
| http: [ip: {127, 0, 0, 1}, port: 5001], | |
| server: true, | |
| live_view: [signing_salt: "aaaaaaaa"], | |
| secret_key_base: String.duplicate("a", 64) | |
| ) | |
| Mix.install([ | |
| {:plug_cowboy, "~> 2.5"}, | |
| {:jason, "~> 1.0"}, |
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
| // How to download telegram sticker images | |
| /* | |
| 1. Go to Telegram Web; | |
| 2. Open console (F12); | |
| 3. Paste the code below in the console and press Enter; | |
| 4. Open your stickers menu and make sure you see the sticker pack you want to download (so Telegram will load it). | |
| 5. At the console paste and run "downloadStickers()" any time you want to download a pack. | |
| 6. [Convert .webm to another format](http://www.freewaregenius.com/convert-webp-image-format-jpg-png-format/); | |
| 7. Happy hacking. |
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
| #!/bin/bash | |
| # Function to install VSCode | |
| install_vscode() { | |
| echo "Installing Visual Studio Code..." | |
| # Update package index | |
| sudo apt update | |
| # Install required dependencies |
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 AlchemistWeb.Endpoint do | |
| use Phoenix.Endpoint, otp_app: :alchemist | |
| def call(conn, opts) do | |
| conn | |
| |> AlchemistWeb.ReplayPlug.call(AlchemistWeb.ReplayPlug.init(nil)) | |
| |> case do | |
| %{halted: true} = conn -> conn | |
| conn -> super(conn, opts) | |
| 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
| #!/bin/bash | |
| cleanup() { | |
| echo "destroy your machine" | |
| fly m destroy --force | |
| exit 0 | |
| } | |
| trap 'cleanup' SIGINT |
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
| Mix.install([ | |
| {:liveview_playground, "~> 0.1.1"} | |
| ]) | |
| defmodule PageLive do | |
| use LiveviewPlaygroundWeb, :live_view | |
| def mount(_params, _session, socket) do | |
| socket = assign(socket, tab: "home") | |
| {:ok, socket} |
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 MarkdownConverter do | |
| import Phoenix.Component | |
| def convert(filepath, body, _attrs, opts) do | |
| convert_body(Path.extname(filepath), body, opts) | |
| end | |
| defp convert_body(extname, body, opts) when extname in [".md", ".markdown", ".livemd"] do | |
| html = | |
| Earmark.as_ast!(body, annotations: "%%") |
NewerOlder