Skip to content

Instantly share code, notes, and snippets.

@pvik
pvik / copilot-usage.sh
Last active November 17, 2026 18:01
copilot-usage
#!/usr/bin/env bash
# copilot-usage: show your GitHub Copilot allowance (AI credits, or premium
# requests on older annual plans) from the terminal.
#
# The live view reads the same internal endpoint Copilot's own tools use
# (api.github.com/copilot_internal/user), signed in with your GitHub CLI login.
# That endpoint is undocumented, so it may change without notice.
#
# -d / -w use GitHub's official billing usage report instead. GitHub only
# keeps that report for Copilot you pay for yourself, and only gives it to a
@pvik
pvik / claude-usage.sh
Last active November 17, 2026 18:01
claude-usage.sh
#!/usr/bin/env bash
# claude-usage: show your Claude plan usage (the numbers /usage shows in
# Claude Code) straight from the terminal, without starting a session.
#
# It reuses the claude.ai login (Pro, Max, Team or Enterprise) that Claude
# Code already saved on this machine and calls the same endpoint /usage calls.
# That endpoint is internal and undocumented, so it may change without notice.
#
# Where Claude Code keeps the login, all of which this script checks:
# macOS Keychain item "Claude Code-credentials" or "Claude Code-credentials-<8 hex>"
#!/usr/bin/env -S uv run --script
# This uses uv to run this python script
# To install uv: https://docs.astral.sh/uv/getting-started/installation/
def sort(width: int, height: int, length: int, mass: int) -> str:
vol = width * height * length
is_bulky = (vol >= 1_000_000) or (width >= 150) or (height >= 150) or (length >= 150)
is_heavy = (mass >= 20)
This file has been truncated, but you can view the full file.
127.0.0.1 000001.ink
127.0.0.1 0001interac.com
127.0.0.1 00043138.com
127.0.0.1 00053138.com
127.0.0.1 00056789.com
127.0.0.1 00063138.com
127.0.0.1 000877009webmaster.000webhostapp.com
127.0.0.1 00093138.com
127.0.0.1 000jq3q.rxportalhosting.com
let increasing (chr_lst : char list) =
List.fold_left
(fun last_int chr ->
if last_int >= 0 then
let chr_int = int_of_string (String.make 1 chr) in
if last_int <= chr_int then
chr_int
else
(-1)
else
let wire1 = ["R98" ; "U47" ; "R26" ; "D63" ; "R33" ; "U87" ; "L62" ; "D20" ; "R33" ; "U53" ; "R51"]
let wire2 = ["U98" ; "R91" ; "D20" ; "R16" ; "D67" ; "R40" ; "U7" ; "R15" ; "U6" ; "R7"]
type point = {
x : float ;
y : float
}
type line = {
p1 : point ;
(set-env!
:source-paths #{"src/scss" "src/clj" "src/cljs" "src/cljc"}
:resource-paths #{"html" "resources"}
:dependencies '[[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.520"]
;; server
[compojure "1.6.1"]
[ring/ring-core "1.7.1"]
[ring/ring-jetty-adapter "1.7.1"]
#!/usr/bin/python
print("hello from python")
@pvik
pvik / i3status.conf
Created September 12, 2018 12:52
i3 status bar config
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
@pvik
pvik / home.html
Last active September 12, 2018 12:37
custom homepage
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="favicon.png" />
<title>elric's home</title>
<!--link rel="stylesheet" href="style.css"-->
<style media="screen" type="text/css">
html {
font-family: Hack;
font-size: 16px;