Skip to content

Instantly share code, notes, and snippets.

@ejpcmac
ejpcmac / shell.nix
Last active March 10, 2021 16:37
Example shell.nix for Nerves projects, setting both Erlang and Elixir versions
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
inherit (lib) optional optionals;
erlangDrv = { mkDerivation }:
mkDerivation rec {
version = "21.0";
@sconstantinides
sconstantinides / PWAs.md
Created May 3, 2018 18:19
How to install a Progressive Web App

How to install a Progressive Web App

Progressive Web Apps (or PWAs) work across browsers and devices. When installed they may include offline support.

iOS Safari

  1. Visit the app’s website
  2. Click the export icon on Safari’s bottom bar
  3. Scroll the options and select “Add to Home Screen”
@edolstra
edolstra / nix-lang.md
Last active May 11, 2025 15:28
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
@micrub
micrub / xmonad-default-key-bindings.md
Last active June 30, 2025 19:43
Xmonad default key bindings

xmonad default key bindings

Action key bindings

Key binding Action
mod - shift - slash Run xmessage with a summary of the default keybindings (useful for beginners)
mod - shift - return Launch terminal
mod - p Launch dmenu
mod - shift - p Launch gmrun
@ykomatsu
ykomatsu / nix-macos.md
Created October 22, 2017 12:50
Installing Nix on macOS in single-user mode
@CMCDragonkai
CMCDragonkai / nix_fetching_functions.md
Last active October 16, 2024 18:46
Nix Fetching Functions #nix

Found all these from nix-repl. Use builtins.fetchTarball for nixpkgs pinning!

builtins.fetchurl
builtins.fetchTarball
pkgs.fetchFromBitbucket
pkgs.fetchFromGitHub
pkgs.fetchFromGitLab
pkgs.fetchFromRepoOrCz
pkgs.fetchFromSavannah
@joepie91
joepie91 / .md
Last active February 25, 2025 21:32
A *complete* listing of operators in Nix, and their predence.

Lower precedence means a stronger binding; ie. this list is sorted from strongest to weakest binding, and in the case of equal precedence between two operators, the associativity decides the binding.

Prec Abbreviation Example Assoc Description
1 SELECT e . attrpath [or def] none Select attribute denoted by the attribute path attrpath from set e. (An attribute path is a dot-separated list of attribute names.) If the attribute doesn’t exist, return default if provided, otherwise abort evaluation.
2 APP e1 e2 left Call function e1 with argument e2.
3 NEG -e none Numeric negation.
4 HAS_ATTR e ? attrpath none Test whether set e contains the attribute denoted by attrpath; return true or false.
5 CONCAT e1 ++ e2 right List concatenation.
6 MUL e1 * e2 le
@Tiberriver256
Tiberriver256 / PowerShellNTFSStaticFileServer.ps1
Last active July 29, 2024 12:16
This script starts a small web server listening on localhost:8080 that will impersonate the authenticated user and serve static content. This means if they do not have NTFS permissions to the file they will get an access denied or a 404 file not found if they do not have NTFS access to list contents of the directory.
function Get-DirectoryContent {
<#
.SYNOPSIS
Function to get directory content
.EXAMPLE
Get-DirectoryContent -Path "C:\" -HeaderName "poshserver.net" -RequestURL "http://poshserver.net" -SubfolderName "/"
@oeb25
oeb25 / default.nix
Last active February 19, 2021 14:35
Elixir/Phoenix Nix and script configuration
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "env";
env = buildEnv { name = name; paths = buildInputs; };
buildInputs = [
yarn
nodejs-6_x
elixir
postgresql96
@chrismccord
chrismccord / upgrade.md
Last active April 7, 2023 12:03
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs: