This file contains 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
final semanticVersionRegex = RegExp( | |
r'^' | |
r'(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)' | |
r'(?:-(?<preRelease>(?:[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)))?' | |
r'(?:\+(?<build>(?:[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)))?' | |
r'$', | |
); | |
/// Tries to parse the given [input] into a [SemanticVersion]. | |
/// |
This file contains 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
{ | |
"Inspect a value": { | |
"prefix": "ins", | |
"description": "Inspect a value with a label", | |
"body": [ | |
"IO.inspect($1, label: \"$1\")" | |
] | |
}, | |
"Pipe inspect": { | |
"prefix": "insp", |
This file contains 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 Utils do | |
@moduledoc """ | |
## Usage | |
Could be imported in <project>/lib/my_app_web.ex for general access. | |
For example in controller/0 | |
```elixir | |
import Utils |
This file contains 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
@doc """ | |
Builds an authorization URL which should be visited by users in order to connect Twitch to your application. | |
Reference: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#implicit-grant-flow | |
""" | |
@spec build_authorization_url( | |
client_id :: String.t(), | |
redirect_uri :: String.t(), | |
scopes :: list(Scope.t()) | |
) :: String.t() |
This file contains 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
extends Light2D | |
@export | |
var one_cycle_in_milliseconds = 1500 | |
@export var min_alpha_number = 0 | |
@export var max_alpha_number = 1 | |
var intermediate_value = 0 |
This file contains 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 Cms.ContentBlock do | |
@moduledoc false | |
use Ecto.Schema | |
import Ecto.Changeset | |
alias Cms.Blocks.TextBlock | |
@supported_block_types [ |
This file contains 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 AdventOfCode2023.Day04 do | |
@moduledoc false | |
require IEx | |
require Logger | |
def run do | |
input = | |
"lib/advent_of_code2023/inputs/04/part1.txt" | |
|> File.read!() |
This file contains 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
type ChannelSpecificCallback = (heartbeat: number) => void | Promise<void>; | |
type GeneralCallback = ( | |
channel: string, | |
heartbeat: number, | |
) => void | Promise<void>; | |
/** | |
* An interface for describing the options which are needed by the HypeRateWebsocket | |
* |
This file contains 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 AdventOfCode2023.Day02 do | |
require Logger | |
def run() do | |
input = | |
File.read!("lib/advent_of_code2023/inputs/02/part1.txt") | |
|> String.trim() | |
|> String.split("\n", trim: true) | |
part1(input) |
This file contains 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 AdventOfCode2023.Day01 do | |
def run() do | |
part1() | |
part2() | |
end | |
defp part1() do | |
File.read!("lib/advent_of_code2023/inputs/01/part1.txt") | |
|> String.trim() | |
|> String.split("\n", trim: true) |
NewerOlder