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
{ | |
description = "A flake for pythonification"; | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs"; | |
flake-utils.url = "github:numtide/flake-utils"; | |
}; | |
outputs = { self, nixpkgs, flake-utils, ... }@inputs: | |
flake-utils.lib.eachSystem ["x86_64-darwin" "aarch64-darwin" "x86_64-linux" "aarch64-linux"] (system: |
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
-- IETF Draft Spec: https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-01.html | |
CREATE SEQUENCE uuidv7_seq MAXVALUE 4095; -- A 12-bit sequence | |
CREATE OR REPLACE FUNCTION generate_uuidv7() | |
RETURNS uuid AS $$ | |
DECLARE | |
unixts bigint; | |
msec bigint; | |
seq bigint; |
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
20231124224207 ~/📄 bash> ollama run llama2-uncensored:70b | |
>>> Could the number 2137940590027877530 be nanoseconds since epoch? | |
No, it's not possible for that number to represent nanoseconds since epoch. The Unix timestamp system uses a base 10 representation of time, with each unit representing a | |
specific period of time. A nanosecond is one billionth of a second, so the maximum number of nanoseconds that can be represented by a 64-bit integer is 2^63 or | |
approximately 252 trillion. However, the number you provided is much larger than this and would therefore not represent any valid unit of time in the Unix timestamp | |
system. | |
>>> Apparently it translates to a date and time of 2037-09-30 16:23:10 UTC since Unix epoch when considered as nanoseconds | |
Yes, that is correct. When the number you provided is converted from its current representation to a base 10 format and interpreted as nanoseconds since epoch, it does | |
correspond to September 30th, 2037 at 4:23 PM UTC. However, as I mentioned earlier, this is not a va |
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
%!PS | |
%%BoundingBox: 0 0 612 792 | |
/Times-Roman findfont 12 scalefont setfont | |
% Define the starting coordinates | |
/x 72 def | |
/y 720 def | |
% Routine to wrap lines | |
/wordbreak ( ) def |
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
(Mainly because I love defeating people's arguments by using their own sources against them...) | |
1 John 2:2 "My little children, these things write I unto you, that ye sin not. And if any man sin, we have an advocate with the Father, Jesus Christ the righteous: He is the propitiation for our sins, and not for ours only but also for the sins of the whole world." | |
1 Corinthians 3:15 "If anyone's work is burned up, he will suffer loss, though he himself will be saved, but only as through fire. 15 But if the work is burned up, the builder will suffer great loss. The builder will be saved, but like someone barely escaping through a wall of flames." | |
1 Timothy 4:10 "For to this end we toil and strive, because we have our hope set on the living God, who is the Savior of all people, especially of those who believe..." | |
1 Peter 3:18 "For Christ also suffered once for sins, the righteous for the unrighteous, to bring you to God." | |
1 Corinthians 15:22 "For as in Adam all die, even so in Christ shall all be made alive." |
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
a few tests using `cjxl` (the reference `jpeg-xl` converter) I performed on a 120.7 MB PNG (the Carina Nebula, first photo from the James Webb Space Telescope): | |
there's 2 main parameters, "distance" (where 0 is lossless and 1 is the least detectable lossy; higher numbers are more lossy) and "effort" (compression effort, where 1 is quick and 9 is exhaustive/very long) | |
distance 0 effort 9 took 3 hours (obviously this is for a "write once, read many" sort of archival use-case) and got it down to about half of PNG, 67.2 MB; not bad for maintaining lossless. | |
distance 0 effort 6 took 1m43s, got it down to 75 MB, about 63% of PNG. | |
distance 1 effort 8 took 3 minutes and got it down to 7.7 MB which is about 1/15th of the PNG. | |
distance 1 effort 6 took 4s; got it to 7.1 MB... wait, _whut?_ That's... odd. Smaller than with effort 8. Anyway. | |
All encodings only used 1 of my 128 cores. Whole-image compression of this nature may not be "trivially parallellizable" ::shrug:: |
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
#!/usr/bin/env bash | |
needs() { | |
local bin="$1"; | |
shift; | |
command -v "$bin" > /dev/null 2>&1 || { | |
printf "%s is required but it's not installed or in PATH; %s\n" "$bin" "$*" 1>&2; | |
return 1 | |
} | |
} |
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 HendricksFormatter do | |
@moduledoc """ | |
This module is a formatter plugin for Elixir's `mix format` task | |
that converts leading whitespace to tabs. | |
It tries to intelligently determine the tab width based on the most common | |
counts of leading space runs in the file. | |
It allows additional space characters for minor adjustments that are below the tab width. | |
OK, why tabs? Why resurrect this age-old nerd debate again? | |
Very simple: It's an accessibility issue: | |
https://adamtuttle.codes/blog/2021/tabs-vs-spaces-its-an-accessibility-issue/ |
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
javascript:(function(){var%20password;var%20regex=/^(?=.*[A-Z].*[A-Z])(?=.*[a-z].*[a-z])(?=.*\d.*\d)(?=.*[!@#$%^&*].*[!@#$%^&*]).{20,}$/;do{password=Array.from(crypto.getRandomValues(new%20Uint32Array(25)),%20x%20=>%20"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"[x%20%%2070]).join('');}while(!regex.test(password));alert(password);})() |
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
#!/usr/bin/env elixir | |
# make sure to bump max erlang processes limit first: | |
# export ERL_FLAGS="+P 2000000" | |
defmodule Concurrency do | |
def millions_of_us(n) do | |
receive do | |
{sender_pid, message} -> | |
Process.sleep(:rand.uniform(2000)) |
NewerOlder