This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install docker in WSL | |
| for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done | |
| sudo apt install ca-certificates curl | |
| sudo install -m 0755 -d /etc/apt/keyrings | |
| sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | |
| sudo chmod a+r /etc/apt/keyrings/docker.asc | |
| echo \ | |
| "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Components.LeafletMap do | |
| use Phoenix.Component | |
| attr :class, :string, default: nil | |
| def map(assigns) do | |
| ~H""" | |
| <div style="overflow: hidden" phx-update="ignore" id="mapcontainer"> | |
| <div class={@class} phx-hook="Map" id="mapid"></div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # search pattern in linux/mac dictionary. Store findings to file. | |
| word_endings=( | |
| ".*kee" | |
| ".*key" | |
| ".*ky" | |
| ".*que" | |
| ".*ki" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* =========================================================================== | |
| * Lars Heinrichs, 2020 | |
| * Feel free to use this piece of code as desired. Provided as is, with no | |
| * guarantees. | |
| * | |
| * "Tests" (in quotes!) for | |
| * https://gist.github.com/larshei/cec020e037b0ebd103ef6252977f8b12 | |
| * Verifies basic behaviour. | |
| * | |
| * Use the gist above if you quickly need a ring buffer and do not care about |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ============== FIFO BUFFER ============================================== */ | |
| /* After writing another small fifo buffers the 100th time, I created this gist. | |
| * It is a QUICK AND DIRTY solution to get the standard functions of a fifo, namely | |
| * - add and read elements | |
| * - check if empty | |
| * - reset | |
| * | |
| * ============== USAGE ====================================================== | |
| * 1. #define the FIFO_DATA_TYPE, FIFO_BUFFER_SIZE and FIFO_MEMORY. | |
| * 2. Optionally: define FIFO_OVERWRITE_WHEN_FULL for ring buffer like behaviour |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // compare times rquired for multiply and divide as well as pointer and array index addressing. | |
| // e.g. from a small port to an STM32F4: | |
| // Required times to scale the 1000 values to max=1.0 for 8192 times: | |
| // Multiply, pointers: 14400 | |
| // Multiply, index: 15938 | |
| // Divide , pointers: 21077 | |
| // Divide , index: 19530 | |
| // The difference is actually a lot smaller than I expected. | |
| #include <time.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # =========== C / Cpp ============== | |
| Language: Cpp | |
| TabWidth: 4 | |
| IndentWidth: 4 | |
| UseTab: Never | |
| AlignAfterOpenBracket: true | |
| AlignConsecutiveAssignments: true | |
| AlignConsecutiveDeclarations: true | |
| # AlignConsecutiveMacros: true # not working 'unknown key' error | |
| AlignEscapedNewlines: Left |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Ceedling Unit Test | |
| on: | |
| push: | |
| branches: [ master, develop ] | |
| pull_request: | |
| branches: [ master, develop ] | |
| jobs: | |
| test: |