Skip to content

Instantly share code, notes, and snippets.

View ssleert's full-sized avatar
🔴
doom, doom, doom, doo-o-o-om

sfome ssleert

🔴
doom, doom, doom, doo-o-o-om
View GitHub Profile
@ssleert
ssleert / ini.c
Last active September 17, 2024 13:43
Super simple stack-only ini parser for embedded systems in C
// Super simple stack-only ini parser
// for embedded systems in C
// 2023 Simon Ryabinkov <ssleert@gmail.com>
#include "ini.h"
#include <assert.h>
#include <string.h>
// return pointer to truncated string
/*
* Copyright (c) 2023 ssleert
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR

Make folder for Nix store

/etc/systemd/system/mkdir-nix.service
[Unit]
Description=Make folder for Nix store
DefaultDependencies=no
Requires=local-fs-pre.target
After=local-fs-pre.target
local use = require('packer').use
require('packer').startup(function()
use 'wbthomason/packer.nvim' -- Package manager
use 'neovim/nvim-lspconfig' -- Configurations for Nvim LSP
end)
local opts = { noremap=true, silent=true }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
package main
import (
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
m := make(map[string]int)
w := strings.Fields(s)