Skip to content

Instantly share code, notes, and snippets.

Karl Bertin kvpb

Block or report user

Report or block kvpb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kvpb
kvpb / script72.sh
Created Feb 10, 2020
Test Script 72: Delete Directory From User Home
View script72.sh
#!/usr/bin/env bash
if [ -d "${symbolic_link_or_directory}" ]; # If symbolic_link_or_directory exists...
then # Then...
if [ -L "${symbolic_link_or_directory}" ]; # If symbolic_link_or_directory is a symbolic link...
then # Then...
rm "${symbolic_link_or_directory}"; # Remove symbolic_link_or_directory.
else # Else, ie if symbolic_link_or_directory is a directory, then...
if [ $(ls -A "${symbolic_link_or_directory}") ]; # If symbolic_link_or_directory is empty...
then # Then...
@kvpb
kvpb / script71.sh
Last active Jun 14, 2019
Test Script 71: BASH pseudorandom brute-force search
View script71.sh
#!/usr/bin/env bash
mkdir directory && cd directory
for i in {0..99}
do
> file${i}
printf "make file${i}\n"
done #for i in {0..0}{0..9}{0..9}; do > file${i}; echo file${i}; done
@kvpb
kvpb / script70.sh
Last active May 13, 2019
Test Script 70: BASH pseudo-multidimensional array iteration over any dimension
View script70.sh
#!/usr/bin/env bash
# script70.sh
# Test Script 70: BASH pseudo-multidimensional array iteration over any dimension
#
# Karl 'Kabe' Bertin `kvpb`
# Phone number: +33xxxxxxxxx
# Email: local-part@domain
# LinkedIn: https://www.linkedin.com/in/karlbertin
# Facebook:
@kvpb
kvpb / license.md
Created Apr 6, 2019
A license that applies to all of Karl Bertin's public gists. https://gist.github.com/kvpb
View license.md

MIT License

Copyright (c) 2014 Karl Bertin

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

@kvpb
kvpb / kbertins42header.txt
Created Apr 6, 2019
kbertin's 42 header, retrieved from an old file from one of the daily projects of the 2014 piscine.
View kbertins42header.txt
" **************************************************************************** "
" "
" ::: :::::::: "
" filename :+: :+: :+: "
" +:+ +:+ +:+ "
" By: kbertin <kbertin@student.42.fr> +#+ +:+ +#+ "
" +#+#+#+#+#+ +#+ "
" Created: YYYY/MM/DD HH:MM:SS by kbertin #+# #+# "
" Updated: YYYY/MM/DD HH:MM:SS by kbertin ### ########.fr "
" "
@kvpb
kvpb / Script.sh
Created Mar 14, 2018
Test script 69: Set macOS keyboard speed
View Script.sh
#!/usr/bin/env bash
# Script.sh
# Test script 69 [because I don't remember how many I did before, but I know I did about 50 anyway]: Set macOS keyboard speed
#
# Karl 'Kabe' Bertin (Карл Бэртин) `kvpb`
# Phone number: +33xxxxxxxxx
# Email: local-part@domain
# LinkedIn: https://www.linkedin.com/in/karlbertin
# Facebook: https://www.facebook.com/karlbertin
You can’t perform that action at this time.