Skip to content

Instantly share code, notes, and snippets.

View webflo-dev's full-sized avatar

Florent webflo-dev

View GitHub Profile
/* selected file list item */
.part.sidebar.right.pane-composite-part {
border: none !important;
}
.monaco-workbench .part > .content {
width: 100% !important;
}
/* comments */
@webflo-dev
webflo-dev / default.nix
Created November 22, 2024 13:27 — forked from yunfachi/default.nix
Nix / NixOS : Import all files from current directory
{...}: {
# imports by full path without copying to /nix/store
imports = builtins.map (n: toString ./. + "/${n}") (builtins.attrNames (builtins.removeAttrs (builtins.readDir ./.) [(builtins.unsafeGetAttrPos "_" {_ = null;}).file]));
# copies all files from the current directory to /nix/store and imports from /nix/store
# imports = builtins.map (n: "${./.}/${n}") (builtins.attrNames (builtins.removeAttrs (builtins.readDir ./.) [(builtins.unsafeGetAttrPos "_" {_ = null;}).file]));
}
@webflo-dev
webflo-dev / nixos-container.nix
Created August 23, 2024 08:37 — forked from KoviRobi/nixos-container.nix
NixOS container example, for a web browser container. Use "sudo systemctl start container@browser" to start.
# vim: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab autoindent syntax=nix nocompatible :
# Containers
{ config, pkgs, ... }:
{ containers.browser =
let hostAddr = "192.168.100.10";
in
{ privateNetwork = true;
hostAddress = hostAddr;
@webflo-dev
webflo-dev / nix_inputs.md
Created August 14, 2024 12:06 — forked from CMCDragonkai/nix_inputs.md
Understanding Nix Inputs #nix

Understanding Nix Inputs

Every Nix derivation produces a Nix store output that has 3 things:

  • Executables
  • Libraries
  • Data

Executables are always exported using the PATH environment variable. This is pretty much automatic.

Setting up qemu VM using nix flakes

Did you know that it is rather easy to setup a VM to test your NixOs configuration?

Create simple flake:

# flake.nix
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
@webflo-dev
webflo-dev / .gitignore
Created April 26, 2024 07:34 — forked from brianm/.gitignore
Go net/rpc over ssh+netcat and unix domain sockets It would be nice if ssh.Session implemented io.ReaderWriter
local_client
server
client
ext
@webflo-dev
webflo-dev / multiselect.sh
Last active November 17, 2022 15:56
multi select bash
#!/bin/bash
function multiselect {
# little helpers for terminal print control and key input
ESC=$( printf "\033")
cursor_blink_on() { printf "$ESC[?25h"; }
cursor_blink_off() { printf "$ESC[?25l"; }
cursor_to() { printf "$ESC[$1;${2:-1}H"; }
print_inactive() { printf "$2 $1 "; }
print_active() { printf "$2 $ESC[7m $1 $ESC[27m"; }
@webflo-dev
webflo-dev / gist:d026ccf4444a49bfe9edfb05c630a5cd
Created August 24, 2022 11:42 — forked from nadeemsyed/gist:c89d67fe5805788b7243
Create a sample shared library in golang 1.5.
nadeem@myznc:~/go/src$ ls -al dummy
total 12
drwxrwxr-x 2 nadeem nadeem 4096 Jul 20 18:46 .
drwxrwxr-x 6 nadeem nadeem 4096 Jul 20 18:45 ..
-rw-rw-r-- 1 nadeem nadeem 129 Jul 20 18:46 hello.go
nadeem@myznc:~/go/src/dummy$ cat hello.go
// Package dummy contains hello world library.
package dummy
@webflo-dev
webflo-dev / alttab
Created February 14, 2022 16:01 — forked from SidharthArya/alttab
Sway Windows Manager Alt Tab behavior
#!/usr/bin/env python3
import sys
import json
import subprocess
direction=bool(sys.argv[1] == 't' or sys.argv[1] == 'T')
swaymsg = subprocess.run(['swaymsg', '-t', 'get_tree'], stdout=subprocess.PIPE)
data = json.loads(swaymsg.stdout)
current = data["nodes"][1]["current_workspace"]
#!/bin/sh
# TODO: If using --criteria on a window in another workspace, sway switches to that workspace
USAGE="\
${0} [--id|--criteria] <index|id|criteria>
Focus/hide the container at <index> in the scratchpad
Depends:
jq
Args: