Skip to content

Instantly share code, notes, and snippets.

View mon-compte-github's full-sized avatar
📺
chilling

Jay Bertrand mon-compte-github

📺
chilling
  • France
View GitHub Profile
@mon-compte-github
mon-compte-github / promise.any.js
Created November 13, 2021 19:36
Promise.any polyfill :-)
if(!Promise.any) {
// may require a polyfill for AggregateError
// https://github.com/es-shims/AggregateError
Promise.prototype.any = /*async <T>*/(iterable /* Iterable<T>*/) /*: Promise<T>*/ => {
// To handle basic types we have to promisify them using Promise.resolve(promise).
return new Promise((resolve, reject) => {
@mon-compte-github
mon-compte-github / LdapSearchFilter.java
Created February 26, 2021 12:52
Ldap search filter parsing
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Manipule un filtre de recherche au format "filtre de recherche ldap".
* La spéc a subit quelques modifications pour l'adapter à nos besoins
* <ul>
@mon-compte-github
mon-compte-github / DNSClient.java
Created February 26, 2021 12:43
Quick & Dirty DNS Client
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.nio.charset.StandardCharsets;
@mon-compte-github
mon-compte-github / Info.plist
Created April 29, 2019 19:25
Codeless KEXT pour la TomTom Runner 3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
@mon-compte-github
mon-compte-github / README.md
Created April 4, 2019 18:24
Bitwise compare of two directory trees under linux/macos
$ rsync -nrcv /dir1 /dir2

Command line explained :

  • -n is dry run which will actually do nothing to any file
  • -v is verbose so it will print out what it would have done
  • -r is recursive so check every file in every folder and
  • -c is check the checksums when comparing rather than just the size and timestamp