Skip to content

Instantly share code, notes, and snippets.

View kassane's full-sized avatar

Matheus C. França kassane

View GitHub Profile
@kassane
kassane / safety.md
Last active September 16, 2024 16:53 — forked from pbackus/safety.md
issue c zig (release-safe) rust (release) Nim (release) Nim (danger) D (@safe) Swift modern C++
out-of-bounds heap read/write none runtime runtime runtime none runtime runtime none³
null pointer dereference none runtime runtime runtime none runtime¹ runtime none⁴
type confusion none runtime, partial runtime compile time compile time compile time compile time partial⁵
integer overflow none runtime runtime runtime none wraps runtime (checked) undefined behavior
use after free none none
@kassane
kassane / Instructions.md
Last active October 1, 2023 13:58 — forked from karbassi/Instructions.md
Create a ZIP file from an SVN url

Installing

  • Need install svn application!!!
  • on svn-zip get gist raw-url
  • Download svn-zip into local folder. For example: curl [raw-url] > svn-zip
  • add run privilege with chmod +x snv-zip or execute bash svn-zip SVN_URL ZIP_FILE_NAME

Usage

In your terminal, use:

@kassane
kassane / forth.zig
Last active January 2, 2023 13:55 — forked from ikskuh/forth.zig
Zig Comptime Forth
//! Tested on Zig v0.10 (stage 1)
const std = @import("std");
test "forwarding a value" {
const result = forth("value", .{
.value = @as(u32, 42),
});
std.testing.expectEqual(@as(u32, 42), result);
@kassane
kassane / xml.zig
Last active March 31, 2023 02:43 — forked from Snektron/xml.zig
XML parser written on Zig - by snektron
/// Copyright © 2020-2022 Robin Voetter
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
/// files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy,
/// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
/// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
/// Software.
///
/// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
@kassane
kassane / std_log.md
Last active April 14, 2025 11:21 — forked from leecannon/std_log.md
Quick overview of Zig's `std.log`

A simple overview of Zig's std.log for Zig v0.12.0 or higher

Logging functionality that supports:

  • If a log message should be printed is determined at comptime, meaning zero overhead for unprinted messages (so just leave the code peppered with debug logs, but when it makes sense scope them; so downstream users can filter them out)
  • Scoped log messages
  • Different log levels per scope
  • Overrideable log output (write to file, database, etc.)
  • All the standard std.fmt formatting magic

Basic Usage:

@kassane
kassane / self-signed-certificate-with-custom-ca.md
Created September 5, 2021 18:55 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@kassane
kassane / zig-em-30-minutos.org
Created May 29, 2021 17:02 — forked from AndersonTorres/zig-em-30-minutos.org
Zig em 30 Minutos (Tradução)
@kassane
kassane / zigupd
Last active January 23, 2021 14:53 — forked from nektro/update_zig.sh
Download Zig latest version
#!/usr/bin/env bash
set -e
cd /tmp
echo "================================================="
echo "Downloading new Zig version:"
curl -s https://ziglang.org/download/index.json \
| jq ".master.\"$(uname -m)-$(uname | awk '{ print tolower($0) }')\"" \
| jq -r .tarball \
| wget -q --show-progress -i -
@kassane
kassane / sudoku.cpp
Created February 29, 2016 13:06 — forked from anaechavarria/sudoku.cpp
Solution to live archive problem 3304
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>