Skip to content

Instantly share code, notes, and snippets.

@ChristopherBiscardi
ChristopherBiscardi / no_pow.asm
Created December 5, 2023 02:04
Assembly output of the detailed rust files using godbolt rust 1.73
# Compilation provided by Compiler Explorer at https://godbolt.org/
example::no_pow:
push rax
mov eax, edi
sub eax, 1
mov dword ptr [rsp + 4], eax
cmp edi, 1
setb al
test al, 1
jne .LBB0_2
@ChristopherBiscardi
ChristopherBiscardi / custom_error.rs
Created February 7, 2023 14:19
nom custom error examples
use color_eyre::eyre::{Result, Context};
use nom::{
bytes::complete::tag,
character::complete::alpha1,
combinator::rest,
error::{ErrorKind, ParseError},
sequence::preceded,
*,
};
use thiserror::Error; // 1.0.38
@ChristopherBiscardi
ChristopherBiscardi / .yabairc
Created September 11, 2022 21:08
What VSCode theme is that? youtube video
# the scripting-addition must be loaded manually if
# you are running yabai on macOS Big Sur. Uncomment
# the following line to have the injection performed
# when the config is executed during startup.
#
# for this to work you must configure sudo such that
# it will be able to run the command without password
sudo yabai --load-sa
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
#import bevy_pbr::mesh_view_bindings
#import bevy_pbr::mesh_bindings
// NOTE: Bindings must come before functions that use them!
#import bevy_pbr::mesh_functions
#import bevy_shader_utils::simplex_noise_3d
#import bevy_shader_utils::simplex_noise_2d
struct StandardMaterial {
@ChristopherBiscardi
ChristopherBiscardi / main.rs
Last active July 15, 2022 11:06
Bevy: Extending StandardMaterial
use bevy::{
asset::AssetServerSettings,
pbr::{
MaterialPipeline, MaterialPipelineKey,
StandardMaterialKey, StandardMaterialUniform,
},
prelude::*,
reflect::TypeUuid,
render::{
mesh::{
@ChristopherBiscardi
ChristopherBiscardi / level.ldtk
Created February 17, 2022 05:52
ldtk json example
{
"__header__": {
"fileType": "LDtk Project JSON",
"app": "LDtk",
"doc": "https://ldtk.io/json",
"schema": "https://ldtk.io/files/JSON_SCHEMA.json",
"appAuthor": "Sebastien 'deepnight' Benard",
"appVersion": "0.9.3",
"url": "https://ldtk.io"
},
@ChristopherBiscardi
ChristopherBiscardi / input.txt
Created December 13, 2021 20:36
aoc-day-13
688,126
1237,406
1228,327
827,189
132,457
641,120
1255,579
1310,187
371,166
576,332
@ChristopherBiscardi
ChristopherBiscardi / netlify.log
Created September 28, 2020 17:15
First successful Toast netlify build of christopherbiscardi.com
9:48:53 AM: Build ready to start
9:48:54 AM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
9:48:54 AM: build-image tag: v3.4.1
9:48:54 AM: buildbot version: 648208d76731cd5bca75c1e9bc99d2032a1f1473
9:48:54 AM: Building without cache
9:48:54 AM: Starting to prepare the repo for build
9:48:55 AM: No cached dependencies found. Cloning fresh repo
9:48:55 AM: git clone git@github.com:ChristopherBiscardi/christopherbiscardi.github.com
9:49:02 AM: Preparing Git Reference refs/heads/toastrs
9:49:04 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'packages/www/public' versus 'www/public' in the Netlify UI
@ChristopherBiscardi
ChristopherBiscardi / temperature-converter-react.js
Created May 18, 2020 07:50
7guis recoiljs temperature converter
import React, { useReducer } from "react";
const cToF = (c) => c * (9 / 5) + 32;
const fToC = (f) => (f - 32) * (5 / 9);
const reducer = (state, action) => {
const parsedPayload = parseInt(action.payload);
const isNaN = Number.isNaN(parsedPayload);
switch (action.type) {
case "setCelcius":
import React, { useState } from "react";
export const Counter = (props) => {
const [count, setCount] = useState(0);
return (
<div>
<input readOnly value={count} />
<button
onClick={(e) => {
setCount(count + 1);