Skip to content

Instantly share code, notes, and snippets.

Cloudef / zig-stdenv.nix
Last active May 16, 2023 01:14
Zig based cross-compiling toolchain
View zig-stdenv.nix
{ pkgs ? import <nixpkgs> {}, lib ? pkgs.lib, stdenv ? pkgs.stdenv, zig ? pkgs.zig, static ? true, target }:
with lib;
with builtins;
# Zig based cross-compiling toolchain
# Major known issues:
# - Zig seems to randomly fail with parallel builds with 'error: unable to build ... CRT file: BuildingLibCObjectFailed'
# This seems like race condition with the cache?
hikari-no-yume / 0_hello-world.c
Last active February 24, 2021 08:26
What would C look like if you compiled it to LLVM IR and back again? (
View 0_hello-world.c
#include <stdio.h>
int main(void)
printf("hello, world\n");

Rust Error Handling Cheatsheet - Result handling functions

Introduction to Rust error handling

Rust error handling is nice but obligatory. Which makes it sometimes plenty of code.

Functions return values of type Result that is "enumeration". In Rust enumeration means complex value that has alternatives and that alternative is shown with a tag.

Result is defined as Ok or Err. The definition is generic, and both alternatives have


Odkazy na statnicove otazky na Dropboxu


Níže najdete odkazy na jednotlivé státnicové otázky programu OI 2016. Odkazy vedou na Dropbox kde můžete doplňovat, komentovat atd.

Jak tisknout

V Dropbox Paper nahoře vpravo > ... > print. V nastavení tisku dejte další možnosti a dejte velikost na 80%, defaultní velikost je strašně velká. Taky doporučuji vypnout všehny informace v zápatí a záhlaví. Defaultně je tam URL, čas apod.

View gen-docs.nix
with import ./. {};
extraSources = [];
lib = pkgs.lib;
optionsListVisible =
lib.filter (opt: opt.visible && !opt.internal)
(lib.optionAttrSetToDocList options);
abn /
Last active December 7, 2022 16:59
Install JetBrains Toolbox App
#!/usr/bin/env bash
# Reference:
# Note that we grep for linux here, if you are using this on mac/windows please see json output
TOOLBOX_URL=$(curl --silent '' \
-H 'Origin:' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Accept-Language: en-US,en;q=0.8' \
-H 'Accept: application/json, text/javascript, */*; q=0.01' \
-H 'Referer:' \
egregius313 /
Last active January 23, 2023 15:55
CS 135 Scheme Cheatsheet
LnL7 / configuration.nix
Last active June 24, 2022 01:45
NixOS configuration overlays
View configuration.nix
{ config, pkgs, ... }:
# Import unstable channel.
# sudo nix-channel --add nixpkgs-unstable
# sudo nix-channel --update nixpkgs-unstable
unstable = import <nixpkgs-unstable> {};
ottidmes / premium-xcursor-theme.nix
Created July 21, 2017 01:12
Custom X cursor in NixOS
View premium-xcursor-theme.nix
{ stdenv, lib, fetchurl, variants ? [ "Premium" "Premium-left" ] }:
with lib;
stdenv.mkDerivation rec {
name = "${package-name}-${version}";
package-name = "premium-xcursor-theme";
version = "0.3";
src = fetchurl {

Installing on Linode

There are now official docs, so follow those as they'll be up-to-date and easier to follow.

Click here to view the old directions

Installing on Linode