Skip to content

Instantly share code, notes, and snippets.

@Cloudef
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
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? (https://github.com/JuliaComputing/llvm-cbe)
View 0_hello-world.c
#include <stdio.h>
int main(void)
{
printf("hello, world\n");
}
View rust-error-cheatsheet.md

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

View STATNICE.md

Odkazy na statnicove otazky na Dropboxu

Zdravím!

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 ./. {};
let
extraSources = [];
lib = pkgs.lib;
optionsListVisible =
lib.filter (opt: opt.visible && !opt.internal)
(lib.optionAttrSetToDocList options);
@abn
abn / install-jetbrains-toolbox.sh
Last active December 7, 2022 16:59
Install JetBrains Toolbox App
View install-jetbrains-toolbox.sh
#!/usr/bin/env bash
# Reference: https://github.com/nagygergo/jetbrains-toolbox-install/blob/master/jetbrains-toolbox.sh
# Note that we grep for linux here, if you are using this on mac/windows please see json output
TOOLBOX_URL=$(curl --silent 'https://data.services.jetbrains.com//products/releases?code=TBA&latest=true&type=release' \
-H 'Origin: https://www.jetbrains.com' \
-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: https://www.jetbrains.com/toolbox/download/' \
@egregius313
egregius313 / scheme-help.md
Last active January 23, 2023 15:55
CS 135 Scheme Cheatsheet
View scheme-help.md
@LnL7
LnL7 / configuration.nix
Last active June 24, 2022 01:45
NixOS configuration overlays
View configuration.nix
{ config, pkgs, ... }:
let
# Import unstable channel.
# sudo nix-channel --add http://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
# sudo nix-channel --update nixpkgs-unstable
unstable = import <nixpkgs-unstable> {};
in
{
@ottidmes
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 {
View NixOS-On-Linode.md

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