Mix.install([
{:ex_png, "~> 1.0"},
{:kino, "~> 0.11.2"},
{:nx, "~> 0.6.3"}
])
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
// Add this to your ghostty config: | |
// custom-shader = "<path to retro.glsl>" | |
#define DISTORTION 0.1 | |
#define BASE_ABERRATION 0.0015 | |
float rand(vec2 co) | |
{ | |
return fract(sin(dot(co.xy, vec2(12.0909, 78.233))) * 43758.5453); | |
} |
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
# Here's a more advanced method that leverages the CIE 1931 XYZ color space | |
# and CIE Lab* color space to convert RGB to RGBW. This approach considers the color | |
# temperature of the white LED and takes into account human perception of color. | |
def gamma_correction(value): | |
if value <= 0.04045: | |
return value / 12.92 | |
else: | |
return ((value + 0.055) / 1.055) ** 2.4 |
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
pub fn sing(from: i32, to: i32) -> String { | |
(to..(from+1)) | |
.rev() | |
.map(|i| verse(i) ).collect::<Vec<_>>() | |
.join("\n") | |
} | |
pub fn verse(n: i32) -> String { | |
let amount = bottles_of_beer(n); |
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
0x07e43Ad3B70aa46A1Fe04bAc9072d0d0759C1479 |
I hereby claim:
- I am lukad on github.
- I am lukad (https://keybase.io/lukad) on keybase.
- I have a public key ASAKYuAXigzjI-t3cXeaNWFmh8Jr7SozhHaa21TQCLlmgwo
To claim this, I am signing this object:
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
JSR main | |
; Main | |
:main | |
JSR setup ; Setup the hardware | |
SET A, msg ; Store msg in A for print_message | |
JSR print_message ; Print our message | |
SET PC, end ; End the program | |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
) | |
func intRangeSlice(start, stop int) []int { | |
if start > stop { |
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"runtime" | |
) | |
func baseCountWork(data []byte, baseChan chan [4]int64) { | |
var bases [4]int64 |
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
class Integer | |
def to_a | |
n = [] | |
x = self | |
while x > 0 | |
n << x.modulo(10) | |
x -= n.last | |
x /= 10 | |
end | |
n.reverse |