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
| # All my gist code is licensed under the terms of the MIT license. | |
| # Video demo: https://www.youtube.com/shorts/mYfEIZFlIwo | |
| # Put this in your .bashrc or something like that | |
| # pretty_print_directory | |
| # - replace $HOME with ~ | |
| # - make everything before the last '/' green, and everything after white and | |
| # bold |
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
| # All my gist code is licensed under the terms of the MIT license. | |
| # Video demo: https://www.youtube.com/shorts/WVyqVkGYb4k | |
| # Add this somewhere in ~/.bashrc | |
| # write_message | |
| # - write a message on the lower right corner of the terminal | |
| function write_message () { | |
| if [[ "$#" -eq 0 ]]; then |
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
| # All my gist code is licensed under the terms of the MIT license. | |
| # Video demo: https://www.youtube.com/watch?v=Yat95AAV5k4 | |
| # from https://unix.stackexchange.com/a/217390/569343 | |
| # write provided text to the terminal input | |
| # (does not work in subshells) | |
| # - There are some weird errors when I remove the 2>/dev/nulls, but I don't | |
| # even know how to begin to fix them. | |
| function write_to_input () { |
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
| #!/usr/bin/env bash | |
| # All my gist code is licensed under the terms of the MIT license. | |
| # GREPDIST | |
| # Print the number of matches in each 10% section of the file | |
| # | |
| # Example with grep: | |
| # $ grep -c 'Napoleon' war_and_peace.txt | |
| # 576 |
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
| # save - Capture and reuse output of command | |
| # A Bash function | |
| # | |
| # usage: save [file] | |
| # | |
| # On start of the Bash session a new temporary file is created that lives as | |
| # long as this terminal session lives. This is the default file. It's path can | |
| # be looked up in the environmental variable $SAVE. Anytime `save` runs, it | |
| # will lookup this variable. The first argument to `save` is a file path that | |
| # will be used as $SAVE file. A manual set file won't be deleted automatically. |
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
| #!/usr/bin/env bash | |
| set -eu # do not proceed on error | |
| if [ $# -lt 1 ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then | |
| cat <<EOF | |
| Quick command to get a shell inside a running docker container. | |
| Usage: dexec [container_name] [command] |
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
| @props(['multiple' => false]) | |
| <div {{ $attributes }} wire:ignore x-data="{ | |
| value: @entangle($attributes->wire('model')), | |
| init(){ | |
| let input = new TomSelect(this.$refs.select, { | |
| onChange: (value) => this.value = value, | |
| items: this.value | |
| }); | |
| } |
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
| package main | |
| import ( | |
| "fmt" | |
| "image" | |
| "image/color" | |
| "image/gif" | |
| "math" | |
| "os" | |
| ) |
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
| Copyright 2023 Carl Mercier | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE |
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
| package views | |
| import ( | |
| "context" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "strings" | |
| "time" |