// dans le module VBA :
// Changez le format la case (A1 ici) selon les besoins
Option Explicit
Sub fillDate()
With Range("A1")
.Value = Now()
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
End With
End Sub
// dans le "ThisWorkbook du VBAProject
// La classe “BeforeSave” est l’évenement interne qui est lancé juste avant la sauvegarde.
// Cette évenement peut alors appeler la fonction “fillDate” définie par l’utilisateur dans le modude VBA.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
fillDate
End Sub
// Avec tout ça, la case A1 ici recevra la date et l’heure d’enregistrement.
// Une façon simple d’insérer la date courante dans une cellule (et qui ne soit pas mise à jour automatiquement,
// mais manuellement quand on veut) est de faire « Ctrl + ; », puis « espace », puis « Ctrl + : », dans la cellule voulue.
/*
`domStr` here should contain everything including <html>, the styles, the title and all.
Use the printing dialogue from your browser to toggle the headers, the backgrounds.
*/
function putInIFrame() {
let domStr = "// HTML string here";
// your #iframe ; can be [hidden] to avoid it beeing shown on screen
const hideFrame = document.getElementById('iframe');
hideFrame.contentWindow.document.body.innerHTML = ""; // empty iframe in case it wasn’t empty
hideFrame.contentWindow.document.write(domStr); // write domStr to iFrame
hideFrame.contentWindow.print(); // print iframe
}
# exporter sa clé ***PUBLIQUE*** (remplacer $GPGKEY par l’adresse e-mail, d’ID ou le nom)
gpg --armor --export-options export-minimal --export $GPGKEY
# exporter sa clé ***PRIVÉE*** (remplacer $GPGKEY par l’adresse e-mail, d’ID ou le nom)
gpg --armor --export-options export-minimal --export-secret-keys $GPGKEY
@echo off
CHCP 65001>nul
dir /B > out.txt
notepad out.txt
exit
@ECHO OFF
:: place le ./ dans le répertoire contenant le fichier .bat
cd %~dp0
ECHO:
ECHO Traitement de tous les fichiers .jpg, de façon récursive dans :
ECHO %~dp0
ECHO:
ECHO Ctrl+C, puis touche 'O' pour annuler, sinon touche ENTREE pour valider.
ECHO:
ECHO:
PAUSE
:: boucle sur les fichiers ET les sous dossiers du répertoire actuel
FOR /f "tokens=*" %%G IN ('DIR /b/s "*.jpg"') DO (
ECHO %%~nxG ...
:: ajoute une bande noire sur le haut de l’image (largeur=687px, hauteur=17px)
convert -fill black -stroke black -draw "rectangle 0,0 687,17" "%%G" "%%G"
:: inscrit le texte (nom du fichier) en blanc dans la bande noire
convert -font Consolas-Bold -fill white -undercolor black -pointsize 15 -gravity NorthWest -draw "text 0,0 '%%~nxG'" "%%G" "%%G"
ECHO OK.
ECHO:
)
# having a bunch of .jpg files in a certain order
# having a list.txt file with matching names for
# the jpg.
# this commande reads the list.txt and matches
# each nth line of the file to the nth file in
# the list, and renames them.
for file in *.jpg; do read line; mv $file "$line"; done < list.txt
;; get Imagemagick : https://imagemagick.org/script/download.php
;; and cd in your dir
;; Crops all JPG to 688x289 px, starting from x=1 and y=156 px.
for /f "tokens=*" %G in ('dir /b/s "*.jpg"') do mogrify -crop 688x289+1+156 "%G"
#!/bin/bash
# for ((i=0;i<100;i++)); do ( echo $i >>out.txt ); done;
cat ./liste.txt | shuf | head -n 10 > new_liste.txt
# for /L %i in (0, 1, 100) DO ( echo %i>>file.txt)
Get-Content .\liste.txt | Get-Random -Count 10 > .\new_liste.txt
#!/bin/sh
OUTPUT=$(zenity --list --title="Sortie Audio" --text "Quelle sortie Audio ?" --column="Id" --column="Nom" 1 "Laptop Speakers" 2 "Laptop Jack");
# LAPTOP SPEAKERS
if [ $OUTPUT -eq 1 ]
then
pacmd set-sink-port alsa_output.pci-0000_00_1f.3.analog-stereo analog-output-speaker # laptop speaker
# LAPTOP JACK
else
pacmd set-sink-port alsa_output.pci-0000_00_1f.3.analog-stereo analog-output-headphones
fi
# see https://lehollandaisvolant.net/?d=2017/06/10/23/37/39-linux-changer-de-sortie-audio-en-un-clic
#!/bin/bash
SIZE=`zenity --scale --text "Pourcetage de réduction :" --value=50 --min-value=5 --max-value=100 --step=1`;
QUALITY=`zenity --scale --text "Pourcentage de conpression JPEG :" --value=85 --min-value=5 --max-value=100 --step=1`;
for i in *.JPG
do
convert -strip -interlace Plane -quality $QUALITY -resize $SIZE% "$i" "$i";
done
for i in *.jpg
do
convert -strip -interlace Plane -quality $QUALITY -resize $SIZE% "$i" "$i";
done
notify-send --icon="info" "Toutes les conversion sont terminée !" ":-)";
<?php
$domain = 'example.com';
$favicon_size = '48';
// using Google Favicon API
$api_url = 'https://www.google.com/s2/favicons?domain='.$domain.'&sz='.$favicon_size;
// retreiving the URL with PHP cURL
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $api_url);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);
$file_content = curl_exec($curl_handle);
curl_close($curl_handle);
// saving the favicon localy
$target_file = './cache/favicons/'.$domain.'.png';
file_put_contents($target_file, $file_content);
// and/or sending to browser
header('Content-Type: image/png');
header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($target_file)).' GMT');
header('Content-Length: ' . filesize($target_file));
header('Cache-Control: public, max-age=2628000');
readfile($target_file);
exit;
ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4
# convertir un fichier
ffmpeg -i audio.flac -c:v copy -c:a alac audio.m4a
# convertir un ensemble de fichiers
for f in ./*; do ffmpeg -i "$f" -c:v copy -c:a alac "${f%.*}.m4a"; done
<Limit POST PUT DELETE>
order allow,deny
allow from all
deny from xxx.xxx.xxx.xxx
</Limit>