Mix.install(
[
{:kino_bumblebee, "~> 0.1.3"},
{:exla, "~> 0.4.1"}
],
config: [nx: [default_backend: EXLA.Backend]]
)
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
| #!/usr/bin/env python3 | |
| """ | |
| Claude Code token usage analyzer. | |
| Analyzes ~/.claude/projects/ JSONL files for token usage patterns. | |
| """ | |
| import json | |
| import os | |
| import sys | |
| from pathlib import Path |
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
| @default_timeout 100 | |
| @check_interval 10 | |
| # Test Helpers | |
| defp wait_for(fun, timeout \\ @default_timeout) do | |
| start_time = System.monotonic_time(:millisecond) | |
| ref = make_ref() | |
| try do |
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
| config :wps, WPSWeb.Endpoint, | |
| live_reload: [ | |
| notify: [ | |
| live_view: [ | |
| ~r"lib/wps_web/core_components.ex$", | |
| ~r"lib/wps_web/(live|components)/.*(ex|heex)$" | |
| ] | |
| ], | |
| patterns: [ | |
| ~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$", |
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, PhoenixDemo.Endpoint, | |
| http: [ip: {127, 0, 0, 1}, port: 8080], | |
| server: true, | |
| live_view: [signing_salt: "bumblebee"], | |
| secret_key_base: String.duplicate("b", 64), | |
| pubsub_server: PhoenixDemo.PubSub | |
| ) | |
| Mix.install([ | |
| {:plug_cowboy, "~> 2.6"}, |
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
| # lib/party_web/components/example_component.ex | |
| defmodule PartyWeb.ExampleComponent do | |
| @moduledoc """ | |
| An example LiveComponent under test. | |
| """ | |
| use Phoenix.LiveComponent | |
| def render(assigns) do | |
| ~H""" | |
| <div> |
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 SqlParser do | |
| def run() do | |
| input = "select col1 from ( | |
| select col2, col3 from ( | |
| select col4, col5, col6 from some_table | |
| ) | |
| ) | |
| " | |
| IO.puts("input: #{inspect(input)}\n") | |
| IO.inspect(parse(input)) |
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 Mix.Tasks.NTest do | |
| use Mix.Task | |
| @wildcard "apps/*/test/**/*_test.exs" | |
| def run([i, n | args]) do | |
| {i, _} = Integer.parse(i) | |
| {n, _} = Integer.parse(n) | |
| test_paths = |
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
| # This file contains the configuration for Credo and you are probably reading | |
| # this after creating it with `mix credo.gen.config`. | |
| # | |
| # If you find anything wrong or unclear in this file, please report an | |
| # issue on GitHub: https://github.com/rrrene/credo/issues | |
| # | |
| %{ | |
| # | |
| # You can have as many configs as you like in the `configs:` field. | |
| configs: [ |
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
| git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }' | |
NewerOlder