This file contains 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/python | |
# | |
# Etant donné un mobile dont la position est donnée par (Lat, Lon, Alt), dont la route vraie est Rou, | |
# la vitesse horizontale Vh, la vitesse verticale Vv, calculer sa position au bout de Tim secondes | |
# Lat est un nombre relatif de -90 à 90 : positif pour les latitudes Nord, négatif pour les latitudes Sud | |
# Lon est un nombre positif de 0 à 360 de longitude Ouest | |
# | |
# Le calcul de la position finale est basé sur une approximation consistant à assimiler à un plan | |
# la portion de sphère où se déplace l'avion. C'est légitime tant que la distance parcourue par l'avion |
This file contains 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
/* | |
Voici les éléments que nous avons à notre disposition à chaque seconde : | |
Longitude: 18.04991 (tronqué ici, mais nous avons une précision plus importante comme source) | |
Latitude: 53.10279 (même remarque) | |
Heading: 261 deg (c'est le "true heading" et pas le "magnetic heading" info ici: https://airplaneacademy.com/whats-the-difference-between-true-and-magnetic-heading-explained/#:~:text=Magnetic%20heading%20is%20your%20direction,being%20hundreds%20of%20miles%20apart) | |
Altitude: 5042 ft (we are all english men here :) | |
Speed: 143.57 Kn (1 Kn = 1.852 km/h) | |
VSpeed: 126.68 f/m (pieds par minute) |
This file contains 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
/* | |
PB: trouver la valeur en degré de la rotation du marker sur a map | |
Solution ??? | |
calcNextRotation() | |
prev: la valeur degré de la rotation actuelle (peut être supérieure à 360) | |
next: la valeur réeel de la diretion de l'avion (compris entre 0 et 360) | |
calcAngle() determine le degré de rotation sans prendre en compte le nombre de tour | |
*/ |
This file contains 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
const fs = require('fs') | |
const {promisify} = require('util') | |
var dns = require('dns') | |
function getMxRecords(domain){ | |
return new Promise(resolve => { | |
dns.resolveMx(domain, function (err, addresses) { | |
if (err) return resolve(null) | |
This file contains 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
const echoMachine = Machine({ | |
id: 'echo', | |
initial: 'listening', | |
states: { | |
listening: { | |
on: { | |
SPEAK: { | |
actions: send({type: 'ECHO', }) | |
}, | |
ECHO: { |
This file contains 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
const idleMachine = Machine({ | |
id: 'idle', | |
initial: 'idle', | |
states: { | |
idle: { | |
entry: 'logEntry', | |
exit: 'logExit' | |
} | |
}, |
This file contains 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
const fetchMachine = Machine({ | |
id: 'lightBulb', | |
initial: 'lit', | |
states: { | |
lit: { | |
exit: () => { | |
console.log('it is cold') | |
}, | |
on: { |
This file contains 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
<?php | |
$raw = file_get_contents(__DIR__.'/Clients.csv'); | |
$lines = explode("\n", trim($raw)); | |
unset($lines[0]); | |
foreach($lines as $i => $line){ | |
list($nom, $prenom, $email) = explode(';', trim($line)); |
This file contains 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
const fs = require('fs') | |
const lineReader = require('readline').createInterface({ | |
input: fs.createReadStream('061018-formated.xml') | |
}); | |
let item = [] | |
let inside = false | |
let index = 1 |
This file contains 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 | |
cd "$(dirname "$0")" | |
echo "Hello hacker !" | |
if [ ! -f ./index.m3u ]; then | |
echo "😬 File index.m3u not found" | |
exit | |
fi |
NewerOlder