defmodule Discourse.OPML do
defmodule Behaviour do
@callback outline(list(String.t())) :: String.t()
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
# Test with different integer sizes | |
small_int = 42 | |
medium_int = 123_456 | |
large_int = 9_876_543_210 | |
small_str = "42" | |
medium_str = "123456" | |
large_str = "9876543210" | |
Benchee.run( |
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
# General AI Notes | |
## The Golden Rule | |
When unsure about implementation details, ALWAYS ask the developer. | |
### Guidelines | |
- Add specially formatted anchor comments throughout the codebase, where appropriate, for yourself as inline knowledge that can be easily `grep`'d for. | |
- Use `AIDEV-NOTE:`, `AIDEV-TODO:`, or `AIDEV-QUESTION:` (all-caps prefix) for comments aimed at AI and developers. |
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
Show hidden characters
{ | |
"language_models": { | |
// No longer needed for OpenRouter: https://github.com/zed-industries/zed/pull/29496 | |
// As of Zed v0.190.0-pre | |
// "openai": { | |
// "api_url": "https://openrouter.ai/api/v1", | |
// "available_models": [ | |
// { | |
// "name": "google/gemini-2.5-pro-preview", | |
// "display_name": "Gemini 2.5 Pro Preview", |
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 TestHelpers do | |
import ExUnit.Assertions, only: [assert: 2, flunk: 1] | |
@spec assert_nested_paths_equal(map(), map(), [atom()]) :: :ok | |
def assert_nested_paths_equal(map1, map2, paths) do | |
Enum.each(paths, fn path -> | |
with {:ok, value1} <- get_nested_field(map1, path), | |
{:ok, value2} <- get_nested_field(map2, path) do | |
assert value1 == value2, | |
"Path #{inspect(path)} differs: #{inspect(value1)} != #{inspect(value2)}" |
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 Simulator do | |
@moduledoc """ | |
Handles parsing of different seed formats for simulation purposes. | |
Supports Git hashes, ISO8601 dates, and normal integer seeds. | |
Based on: | |
- https://docs.tigerbeetle.com/about/vopr/ | |
- https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/HACKING.md#simulation-tests | |
- https://github.com/tigerbeetle/tigerbeetle/blob/main/src/testing/fuzz.zig#L72-L90 | |
- https://github.com/whatyouhide/stream_data/blob/main/lib/ex_unit_properties.ex#L674-L689 |
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
#!/opt/homebrew/bin/bash | |
# | |
# A script that checks for previously failed tests, caches them to a file, and reruns only | |
# those tests again. Slightly more useful than `mix test --failed` alone because you can | |
# share/store your set of test failures however you want. | |
# | |
# TODO: Someday turn this into an ExUnit formatter: https://hexdocs.pm/ex_unit/ExUnit.Formatter.html | |
# - https://github.com/crertel/exunit_json_formatter/blob/master/lib/exunit_json_formatter.ex | |
# - https://github.com/findmypast-oss/exunit_json_formatter/blob/master/lib/exunit_json_formatter.ex |
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
// ==UserScript== | |
// @name Intercept m3u8 streams | |
// @description Intercept XHR/fetch requests involving m3u8 stream identifiers | |
// @namespace Violentmonkey Scripts | |
// @match *://*/* | |
// @version 0.1 | |
// @author Noah Betzen | |
// @grant none | |
// ==/UserScript== |
As of August 15, 2024, it's been announced that the three projects bein compared here will soon merge! See the official Elixir blog post for more details: https://elixir-lang.org/blog/2024/08/15/welcome-elixir-language-server-team/
We'll be comparing the following:
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
# Usage `cache ls` or `cache ./myScript.sh` | |
cache() { | |
local expiry_minutes=20 | |
local command_name="$1" | |
local command_hash=$(echo "$*" | md5sum | cut -d' ' -f1) | |
local cache_dir="$HOME/.cache/cli_cache" | |
local command_cache_dir="$cache_dir/$command_name" | |
local cache_file="$cache_dir/$command_hash" |
NewerOlder