Skip to content

Instantly share code, notes, and snippets.

View Bludwarf's full-sized avatar
🐶
Working from home

Mathieu Lavigne Bludwarf

🐶
Working from home
View GitHub Profile
@Bludwarf
Bludwarf / import-certs.ps1
Created August 2, 2023 10:00
Powershell script to import certificates from a directory to a Java trust store file
$source_dir = "C:\certs"
$keystore = "C:\Java\truststore.jks"
$cert_extensions = @(
"*.cer",
"*.crt",
"*.der",
"*.pem"
)
@Bludwarf
Bludwarf / change-detection.component.ts
Last active April 27, 2023 15:33
Angular change detection with MatTableDataSource
import {ChangeDetectionStrategy, Component, DoCheck, KeyValueDiffer, KeyValueDiffers} from '@angular/core';
import {MatTableDataSource} from '@angular/material';
interface Data {
}
const DATA: Data[] = [];
/**
* Provoque un changement de données pour qu'Angular détecte que les données ont été modifiées même si la variable n'a pas été modifiée.
#!/bin/sh
# Prend chaque fichier commençant par 8 chiffres et le déplace dans le sous-dossier correspondant.
#
# Exemple :
#
# Le fichier :
#
# 20201229_100822 - Théo danse en cuisinant.mp4
#
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.bludwarf</groupId>
<artifactId>commons</artifactId>
<version>1.0-DEV</version>
<name>Librairies communes</name>
<description>Librairies communes de Bludwarf</description>
<properties>
@Bludwarf
Bludwarf / application.properties
Created March 3, 2023 11:16
Activer les logs DEBUG HTTP sur Spring
logging.level.reactor.netty.http.client=debug
logging.level.org.apache.http=DEBUG
@Bludwarf
Bludwarf / .travis.yml
Last active November 17, 2019 00:20
Travis build for Angular app on GitHub
language: node_js
node_js:
- "10"
sudo: false
dist: trusty
#addons:
# apt:
# sources:
# - google-chrome
# packages:
import {Injectable} from '@angular/core';
import {FlatTreeControl} from '@angular/cdk/tree';
import {CollectionViewer, SelectionChange} from '@angular/cdk/collections';
import {BehaviorSubject, merge, Observable} from 'rxjs';
import {map} from 'rxjs/operators';
/** Flat node with expandable and level information */
export class DynamicFlatNode<T> {
constructor(public item: T, public level: number = 1, public hasChildren: boolean = false, public isLoading: boolean = false) {}
@Bludwarf
Bludwarf / shared-worker.service.ts
Created March 9, 2019 12:26
Adaptation of "worker.service.ts" by Daniel Amores for SharedWorker
///<reference path='../../../node_modules/@types/sharedworker/index.d.ts'/>
import {Injectable} from '@angular/core';
function loadScript(url, callback) {
// Add a the script tag to the head
const head = document.getElementsByTagName('head')[0];
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
@Bludwarf
Bludwarf / UrlUtils.js
Last active August 8, 2018 17:24
Everyday JavaScript utilities
var UrlUtils = {};
/**
* @param url? par défaut on prend l'URL actuelle
* @returns la liste des paramètres dans l'URL (URL décodé)
*/
UrlUtils.getParams = function(url) {
var result = {};
var search;