Skip to content

Instantly share code, notes, and snippets.

View danbst's full-sized avatar

Danylo Hlynskyi danbst

  • Ivano-Frankivsk, Ukraine
View GitHub Profile
@gullyn
gullyn / flappy.html
Last active May 4, 2024 15:35
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@edolstra
edolstra / nix-lang.md
Last active October 30, 2024 00:36
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to
# nixos-rebuild build-vm -I nixpkgs=/home/eric/Projects/nixos/nixpkgs -I nixos-config=/tmp/wireguard-conf.nix
{ config, pkgs, ... }:
{
imports =
[
<nixos/modules/installer/scan/not-detected.nix>
];
nix.maxJobs = 4;
@Pitometsu
Pitometsu / configuration.nix
Last active July 11, 2023 18:58
NixOS system config
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
rec {
imports =
@thoughtpolice
thoughtpolice / phabricator.nix
Created July 15, 2015 16:26
Extensive Phabricator module for NixOS (with Nginx frontend support)
/*
Example usage (in configuration.nix):
services.phabricator.enable = true;
services.phabricator.baseURI = "secure.example.org";
services.phabricator.baseFilesURI = "secure-files.example.org";
services.phabricator.extensions =
{ libphutil-scrypt = "git://github.com/haskell-infra/libphutil-scrypt.git";
libphutil-yubikey = "git://github.com/thoughtpolice/libphutil-yubikey.git";
@travisbhartwell
travisbhartwell / nix-shell-shebang.md
Last active March 29, 2024 19:55
nix-shell and Shebang Lines

NOTE: a more up-to-date version of this can be found on my blog

nix-shell and Shebang Lines

A few days ago, version 1.9 of the Nix package manager was released. From the release notes:

nix-shell can now be used as a #!-interpreter. This allows you to write scripts that dynamically fetch their own dependencies.

@danbst
danbst / hask5.lhs
Last active October 2, 2015 17:08
Console Tetris
ТЕТРІС 0.0.0.12
Реалізація класичного тетріса (з урізаними можливостями), з виводом у консоль.
Урізано: відображення наступної фігури та рахунку
клавіша прискореного падіння фігури
рівні та зміна швидкостей
Код переписано багато разів, з кожним разом він ставав все кращим та кращим.
> {-# LANGUAGE TemplateHaskell #-}