premier commit

This commit is contained in:
_N3m0 2023-02-01 19:08:43 +01:00
commit 27d59dc3bc
22 changed files with 393 additions and 0 deletions

22
completion Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
cmpt_mcm(){
for opt in `ls --ignore=*.jar ~/.minecraft/mods`; do
COMPREPLY+=("$opt")
done
}
complete -F cmpt_mcm mcm
cmpt_newp(){
for opt in `ls ~/dev/script/newp-template`; do
COMPREPLY+=("${opt%.*}")
done
}
complete -F cmpt_newp newp
cmpt_prj(){
for opt in `ls ~/dev`; do
COMPREPLY+=("$opt")
done
}
complete -F cmpt_prj prj

35
cpl Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
if [[ $1 != "" ]]; then
cd $1 2>/dev/null
fi
if [ $(ls CMakeLists.txt 2>/dev/null) ]; then # cpp
project=$(grep "^\(project(\)" CMakeLists.txt) || exit
project=${project#project(}
project=${project%% *}
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make
./$project
elif [[ ${1##*.} = "py" ]]; then # py
python3 $1
elif [ $(ls *.gpr 2>/dev/null) ]; then # ada
gprbuild $(ls *.gpr) && echo -e "\nexecutable :" && ls -F obj | grep "*$"
elif [[ ${1##*.} = "sh" ]]; then # bash
chmod +x $1
elif [ $(ls .webconfig 2>/dev/null) ]; then # web
rm -rf dst/.files
name=$(grep name .webconfig)
name=${name##* }
link=$(grep link .webconfig)
link=${link##* }
ssg src dst "$name" "$link"
elif [ $(find -name "*.java" | wc -l) -ge 1 ]; then # java
find -name "*.java" > .files
javac -cp lib/*.jar -d build/ @.files
name=$(pwd)
name=${name##*/}
cd build
java $name
fi

7
lol Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
if [[ $1 = "" ]]; then
fortune | cowsay -f tux | lolcat
else
cowsay -f tux $1 | lolcat
fi

15
mcm Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
load=$1
cd ~/.minecraft/mods
for modpack in `ls --ignore=*.jar`; do
if [ $(ls $modpack | wc -l) -eq 0 ]; then
mv *.jar $modpack
fi
done
if [[ $load != "" ]]; then
mv $load/*.jar .
fi

28
newp Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
case $1 in
sh) cp ~/dev/script/newp-template/sh.template $2 ;;
cpp) cp -r ~/dev/script/newp-template/cpp.template $2
cd $2
touch CMakeLists.temp
name=${2##*/}
sed "s/^\(project(cpp.template\)/project($name/" CMakeLists.txt > CMakeLists.temp
cat CMakeLists.temp > CMakeLists.txt
rm CMakeLists.temp
echo $2 > .wakatime-project;;
web) cp -r ~/dev/script/newp-template/web.template $2
cd $2
echo "name : $2" > .webconfig
if [[ $3 != "" ]]; then
echo "link : $3" >> .webconfig
else
echo "link : http://www" >> .webconfig
fi
echo $2 > .wakatime-project;;
java) cp -r ~/dev/script/newp-template/java.template $2
cd $2
touch src/$2.java
sed "s/template/$2/" src/template.java > src/$2.java
rm src/template.java
echo $2 > .wakatime-project;;
esac

View File

@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.10)
# Project
project(cpp.template LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS off)
set(CMAKE_CXX_FLAGS "-Wall -Weffc++ -Wextra -Wsign-conversion")
# Sources
file(GLOB_RECURSE SOURCES src/*.cpp)
file(GLOB_RECURSE HEADERS includes/*.hpp includes/*.h src/*.hpp src/*.h)
# ex librairie
# find_package(exlib REQUIRED) # ou QUIET (req = obligée, si erreur stop ; quiet = si erreur, informe et continue)
# include_directories(${exlib_INCLUDE_DIRS}) # optionnel, si erreur chercher exlibCONFIG.cmake pour trouver le $() qui convient
# link_directories(${exlib_LIB_DIRS}) # optionnel; pareil qu'en dessus
# add_definitions(${exlib_FLAGS})
# Executable
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
# suite exlib
# target_link_libraries(${PROJECT_NAME} ${exlib_LIBRARIES})
# Includes
target_include_directories(${PROJECT_NAME} PUBLIC includes)
target_include_directories(${PROJECT_NAME} PUBLIC src)
# tuto
# https://www.youtube.com/watch?v=9fowTjLimxQ tuto cmake
# https://www.youtube.com/watch?v=Lrt3i83wsy4 tuto cmake lib

View File

@ -0,0 +1,6 @@
#include <iostream>
int main(){
std::cout << "Hello World!" << std::endl;
return 0;
}

View File

View File

@ -0,0 +1,6 @@
public class template{
public static void main(String [] args){
System.out.println("Hello world!");
}
}

3
newp-template/sh.template Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
echo "Hello Bash"

View File

@ -0,0 +1,2 @@
name :
link :

View File

@ -0,0 +1,2 @@
</body>
</html>

View File

@ -0,0 +1,11 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title></title>
</head>
<body>
<div id="menu">
<a href="accueil.html">ACCUEIL</a>
<a href="accueil.html"><img src="img/logo.png"></a>
<a href="article.html">ARTICLE</a>
</div>

View File

@ -0,0 +1,3 @@
---
# Accueil
---

View File

@ -0,0 +1,7 @@
---
# Article
---
+ *10 janv 2023* - [MD Test](mdtest.html)
+ *10 janv 2023* - [Article](article.html)
+ *10 janv 2023* - [Accueil](accueil.html)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,81 @@
---
# Markdown Template
---
[link to menu](menu.html)
### debut
Les paragraphes sont separrées par des ligne vides,
**le texte en gras** est entouré par deux astérix,
*le texte en italique* est entouré par un astérix,
et ~~le barré~~ et entouré par deu vague (~).
pour sauté une ligne
il faut deux espace a la fin de la linge.
[un lien](https://www.youtube.com/watch?v=dQw4w9WgXcQ).
![une image](img/whyareyougay.jpg)
le ! permet d'afficher l'image
[un autre lien](hihiha "avec un petit texte")
| je | suis | 1 |
|------|---------|---|
| un | tableau | 2 |
| hihi | ha | 3 |
---
| 0 | / | hihiha |
|:--|-------------|--------------------------------------------------------------------------------:|
| 1 | information | je suis un information tres crucial car j'aime le zizi surtou le fromage autour |
| 2 | description | neamoins j'aime aussi les carte graphique, sa croustille sous la dents |
un peut de code :
#include <iostream>
int main(){
std::cout << "hamood is sus!" << std::endl;
return 0;
}
encore un peut plus
$ fortune | cowsay -f tux | lolcat
voici de sage parole
> je suis une citation
ou peut etre pas
> eh ouais ma geueule
ou bien les pieds
> hihiha
+ une
+ liste
- rien
- de
+ normal
- plus
+ classique
1. a
1. moins
1. que
tu prefere
42. celle
1. ci
+ ou
+ celle
1. la

View File

@ -0,0 +1,73 @@
body{
max-width: 800px;
margin: auto;
background-color: #000000;
color: #cccccc;
font-size: 1.3rem;
font-family: arial;
}
a{
color: #ffddaa;
}
a:visited{
color: #bbaa88;
}
a:hover{
color: #ffffff;
}
pre{
font-family: "menlo";
font-size: 1rem;
color: #cccccc;
font-weight: bold;
border: 0.2rem solid #cccccc;
border-radius: 15px;
padding : 1rem;
}
img{
display: block;
margin: auto;
}
blockquote{
padding: 0.1rem;
padding-left: 1rem;
padding-right: 1rem;
border-radius: 25px;
background-color: #cccccc;
color: #000000;
}
table{
border-collapse: collapse;
}
th, td{
padding: 0.75rem;
border: solid #cccccc;
border-radius: 50px;
}
#menu{
display: flex;
justify-content: center;
align-items: center;
}
#menu a{
text-decoration: none;
margin-left: 3rem;
margin-right: 3rem;
}
#menu a:visited{
color: #ffddaa;
}
#menu img{
margin-left: 1rem;
margin-right: 1rem;
}

4
prj Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
cd ~/dev
cd $1 2>/dev/null && nvim . || ( ( cd ${1%/*} 2>/dev/null && nvim ${1##*/} ) || nvim $1 )

37
rld-comp Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
#comp=`cat completion`
#echo $comp
#
#opt=$(ls ~/.minecraft/mods)
#comp=$(sed "s/'.*' mcm/'`echo $opt`' mcm \n/" <<< $comp)
#
#opt=""
#fich=$(ls ~/dev/script/newp-template)
#for var in $fich; do
# opt+=" ${var%.*}"
#done
#comp=$(sed "s/'.*' newp/'`echo $opt`' newp;/" <<< $comp)
#
#opt=$(ls ~/dev)
#comp=$(sed "s/'.*' prj/'`echo $opt`' prj;/" <<< $comp)
#
#echo -e $comp
cd ~/dev/script
rm completion
touch completion
echo "#!/bin/bash" >> completion
echo "complete -W '"$(ls ~/.minecraft/mods)"' mcm" >> completion
fich=$(ls ~/dev/script/newp-template)
for var in $fich; do
opt+=" ${var%.*}"
done
opt=${opt# }
echo "complete -W '$opt' newp" >> completion
echo "complete -W '"$(ls ~/dev)"' prj" >> completion
. ./completion

20
rls Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
if [ $1 != "" ]; then
cd $1
fi
project=$(grep "^\(project(\)" CMakeLists.txt) || exit
project=${project#project(}
project=${project%% *}
cd $(pwd)/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
figlet "noice" | lolcat
echo -n "lunch $project ? (y/n) "
read input
if [[ input -eq "y" ]]; then
./$project
fi