Skip to content

Instantly share code, notes, and snippets.

View pauljeandel's full-sized avatar

Paul Jeandel pauljeandel

  • Polytech Marseille
  • Marseille
View GitHub Profile
@pauljeandel
pauljeandel / unactive_branches.sh
Created July 5, 2022 07:55
Get all the branch with the last update date
WARNING_LIMIT=2022
ERROR_LIMIT=2021
main(){
# if $1 exist
if [ -n "$1" ];then
ERROR_LIMIT=$1
WARNING_LIMIT=$((ERROR_LIMIT+1))
fi
@pauljeandel
pauljeandel / getalltext.js
Last active June 23, 2022 14:45
Get all TextNode from website
function dlText() {
let collectedText;
const html = document.querySelectorAll('html');
for(let i = 0; i < html.length; i++){
collectedText += html[i].innerText;
}
collectedText = collectedText.replace('undefined', '');
let newStr = JSON.stringify(collectedText);
newStr = newStr.substring(0, newStr.length-1);
newStr = newStr.substring(1);
#!/bin/bash
if [ "$1" == "init" ]; then
git submodule init
git submodule update
exit 0
elif [ "$1" == "update" ]; then
echo -n " Êtes vous sur d'être dans le dossier demo/ et d'être sur la bonne branche ? [y/N] "
read answer
if [ "$answer" == "y" ] || [ "$answer" == "Y" ]; then
#!/bin/bash
# Usage : bash update-constructeur.sh [acf-project-path] [branch-to-check]
if [ "$1" == "-h" ] || [ "$1" == "help" ]
then
echo
echo "Usage : bash update-constructeur.sh [acf-project-path] [branch-to-check]"
echo " [acf-project-path] : chemin du projet ACF"
echo " [branch-to-check] : branche à vérifier"
echo " [help] : affiche cette aide"
@pauljeandel
pauljeandel / ParticleFalling.html
Last active December 9, 2021 23:27
ParticleJs - Particules qui tombent
<!-- particles.js container -->
<div id="particles-js"></div>
<!-- stats - count particles -->
<div class="count-particles">
<span class="js-count-particles">--</span> particles </div>
<!-- particles.js lib - https://github.com/VincentGarreau/particles.js -->
<script src="http://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<!-- stats.js lib -->
<script src="http://threejs.org/examples/js/libs/stats.min.js"></script>
@pauljeandel
pauljeandel / WordCount.py
Created August 3, 2021 16:58
Count the iterations of words in a text
Text=""
for char in '-.,\n':
Text=Text.replace(char,' ')
Text = Text.lower()
word_list = Text.split()
d = {}
@pauljeandel
pauljeandel / getLastTag.sh
Last active August 3, 2021 17:43
Get the latest tag of GitHub Repo in shell CLI without GitHub API
#Usage : bash getLastTag.sh <[GIT_USERNAME]/[GIT_REPO]>
content=$(wget https://github.com/$1/releases -q -O -)
lastRelease=$(echo "$content" | tr ' ' '\n' | grep -n /$1/releases/tag/ | grep -oP '(?<=tag\/)[^"]*')
@pauljeandel
pauljeandel / DHCP_Listen_Multicast.py
Last active December 9, 2021 23:30
Allow you to know when someone connect to your wifi
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
#s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
s.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_TTL, 20)
s.setsockopt(socket.SOL_IP, socket.IP_MULTICAST_LOOP, 1)
@pauljeandel
pauljeandel / Read_Text_On_Image.py
Last active December 9, 2021 23:30
Get the text from an image with ComputerVision
# Require : PIL / Pillow (pip)
# Require : Pytesseract (pip)
import sys
try:
from PIL import Image
except ImportError:
import Image
import pytesseract