Skip to content

Instantly share code, notes, and snippets.

View Chriscbr's full-sized avatar

Chris Rybicki Chriscbr

View GitHub Profile
@Chriscbr
Chriscbr / numbers.asm
Created July 14, 2024 03:35
Prints numbers from a file - written in NASM
; nasm -fmacho64 numbers.asm && gcc numbers.o -o numbers && ./numbers
global _main
extern _printf
extern _scanf
extern _fopen
extern _fgets
extern _atoi
section .text
"""
Goal: try to find a functions f(x) and g(x) such that f(g(x)) is increasing and g(f(x)) is decreasing.
(This program does not solve the puzzle.)
"""
import math
fns = [
(lambda x: 0, "0"),
#!/bin/bash
set -euxo pipefail
# Ensure AWS CLI is installed
if ! command -v aws &> /dev/null; then
echo "AWS CLI is not installed. Please install it and configure it."
exit 1
fi
# List all APIs and delete them
use gpui::prelude::*;
use gpui::*;
struct Counter {
count: usize,
}
impl Render for Counter {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
let mut button = div()
@Chriscbr
Chriscbr / uninit-alloc-bench.rs
Created February 1, 2024 02:54
use `cargo bench` with toolchain set to nightly
#![feature(test)]
extern crate test;
use test::Bencher;
const SIZE: usize = 2 << 10;
#[bench]
fn bench_zeroed_memory(b: &mut Bencher) {
b.iter(|| {
@Chriscbr
Chriscbr / perf3.log
Created January 19, 2024 20:42
wing compile -t tf-aws (complex app)
2024-01-19T20:18:48.186Z cli called
2024-01-19T20:18:48.210Z main called
2024-01-19T20:18:48.215Z importing command
2024-01-19T20:18:48.245Z calling imported command
2024-01-19T20:18:48.245Z compile called
2024-01-19T20:18:48.245Z globbing finished
2024-01-19T20:18:48.245Z setting up synthesis dir
2024-01-19T20:18:48.269Z finished setting up synthesis dir
2024-01-19T20:18:48.269Z loading wingc
2024-01-19T20:18:48.277Z invoking wingc
@Chriscbr
Chriscbr / perf2.log
Last active January 19, 2024 20:42
wing compile -t tf-aws (simple app)
2024-01-19T20:39:52.816Z cli called
2024-01-19T20:39:52.854Z main called
2024-01-19T20:39:52.861Z importing command
2024-01-19T20:39:52.909Z calling imported command
2024-01-19T20:39:52.909Z compile called
2024-01-19T20:39:52.909Z globbing finished
2024-01-19T20:39:52.910Z setting up synthesis dir
2024-01-19T20:39:52.913Z finished setting up synthesis dir
2024-01-19T20:39:52.913Z loading wingc
2024-01-19T20:39:52.944Z invoking wingc
@Chriscbr
Chriscbr / perf1.log
Last active January 19, 2024 20:40
wing test -t sim (simple app)
2024-01-19T19:54:36.424Z cli called
2024-01-19T19:54:36.448Z main called
2024-01-19T19:54:36.454Z importing command
2024-01-19T19:54:36.696Z calling imported command
2024-01-19T19:54:36.696Z test called
2024-01-19T19:54:36.700Z testOne called
2024-01-19T19:54:36.700Z compile called
2024-01-19T19:54:36.700Z globbing finished
2024-01-19T19:54:36.936Z compiling finished
2024-01-19T19:54:36.936Z compile finished
use bit_set::BitSet;
use rand::Rng;
use std::time::Instant;
use thinset::SparseSet;
const SMALL_SIZE: usize = 1 << 12;
const LARGE_SIZE: usize = 1 << 20;
fn generate_number(cap: usize) -> usize {
let mut rng = rand::thread_rng();
bring cloud;
bring tracing;
let tracer = new tracing.Tracer();
let api = new cloud.Api();
api.post("/users", inflight (req) => {
let span = tracer.startSpan("create_user");
tracer.log(tracing.Level.INFO, "create user started");