Skip to content

Instantly share code, notes, and snippets.

@McSinyx
McSinyx / build.zig
Created September 7, 2021 11:12
Zig extern struct recognized differently from Zig and C
const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
const exe = b.addExecutable("test", "main.zig");
exe.addIncludeDir(".");
exe.linkSystemLibrary("c");
exe.setTarget(b.standardTargetOptions(.{}));
exe.setBuildMode(b.standardReleaseOptions());
exe.install();
@McSinyx
McSinyx / keybase.md
Created May 24, 2021 15:03
Prove my GitHub identity

Keybase proof

I hereby claim:

  • I am McSinyx on github.
  • I am mcsinyx (https://keybase.io/mcsinyx) on keybase.
  • I have a public key whose fingerprint is E90E 11B8 0493 343B 6132 E394 2714 8B2C 06A2 224B

To claim this, I am signing this object:

@McSinyx
McSinyx / start.html
Last active October 11, 2020 04:29
Abstract Start Page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Start Page</title>
<style type="text/css" media="screen">
@namespace svg url(http://www.w3.org/2000/svg);
svg {
display: block;
position: absolute;
@McSinyx
McSinyx / min.css
Last active September 4, 2020 02:32
HTML template with 80-char width and tango color palette
/*
* A 80-char wide stylesheet with Tango color palette
* Copyright 2016 Raphael McSinyx
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@McSinyx
McSinyx / extras_provider.py
Last active June 2, 2020 04:21
Resolve wheel requirements from PyPI with parallel download
"""A provider that handles packages with "extras".
Python package dependencies can include "extras", which are additional
dependencies that are installed "on demand". For instance, project X could
have an additional set of dependencies if PDF generation features are needed.
These can be defined for an extra "pdf" and requested on install as X[pdf].
The basic resolvelib algorithm cannot handle extras, as it builds a dependency
graph which needs to be static - the edges (dependencies) from a node
(candidate) must be fixed. Extras break this assumption.
@McSinyx
McSinyx / anon.pdf
Last active April 15, 2020 09:37
System Cascade Connection
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@McSinyx
McSinyx / archaicy-aliases.h
Last active December 18, 2019 15:38
Alure play in Cython
// Aliases for relevant STL containers not declarable in Cython
// Copyright (C) 2019 Nguyễn Gia Phong
//
// This file is part of archaicy.
//
// archaicy is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
@McSinyx
McSinyx / problems.pdf
Last active October 8, 2019 06:27
Probability et Statistiques
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@McSinyx
McSinyx / cons-sequences.md
Last active September 21, 2019 14:01
Infinite Sequences: A Case Study in Functional Python

Infinite Sequences: A Case Study in Functional Python

In this article, we will only consider sequences defined by a function whose domain is a subset of the set of all integers. Such sequences will be visualized, i.e. we will try to evaluate the first few (thousand) elements, using functional programming paradigm, where functions are more similar to the ones in math (in contrast to imperative style with side effects confusing to inexperenced coders). The idea is taken from subsection 3.5.2 of SICP and adapted to Python, which, compare to Scheme, is significantly more popular:

@McSinyx
McSinyx / chroot-mnt.sh
Last active September 15, 2019 07:41
Change root
mount /dev/nvme0n1p3 /mnt
mount /dev/nvme0n1p4 /mnt/home
mount /dev/nvme0n1p1 /mnt/boot/efi
mount --types proc /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --make-rslave /mnt/sys
mount --rbind /dev /mnt/dev
mount --make-rslave /mnt/dev
chroot /mnt /bin/bash
umount -l /mnt/dev{/shm,/pts,}