Skip to content

Instantly share code, notes, and snippets.

View tsimbalar's full-sized avatar

Thibaud Desodt tsimbalar

View GitHub Profile
@tsimbalar
tsimbalar / pubspec.lock
Created March 28, 2023 16:44
Dependabot report
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "503361166f4a100e0d7eb7fb5a62c6f0322512f2bcb48d6922caf98f24b0ab90"
url: "https://pub.dev"
source: hosted
@tsimbalar
tsimbalar / exercise-status.dart
Created February 4, 2021 14:05
exercise status
// from the outside we see :
abstract class Step{
bool get isLocked; // computed based on the state of previous steps
// = !(previousExercise === null || previousExercise.isMarkedAsCompleted)
bool get isFinished; // computed based on the fact that all the exercises in this step are completed
// == step.exercises.all.status === finished
@tsimbalar
tsimbalar / README.md
Last active March 4, 2024 01:40
Open API Diff breaking changes - GitHub Actions

I couldn't get https://github.com/evereepay/openapi-diff-action to work for me, so ended up doing it a bit more manually, by invoking directly https://github.com/quen2404/openapi-diff and generating a comment for the PR with https://github.com/actions/github-script

To do that you need :

  • the script check-openapi-diff.sh ... in my case it is in the .ci folder at the root of our repo
  • the GitHub Actions workflow openapi.yaml. It needs to be under the folder .github/workflows of the repo
  • possibly adapt some paths here and there in the openapi.yaml file
@tsimbalar
tsimbalar / json-datestring-to-date.ts
Last active June 16, 2019 11:05
An example of a helper function to map an object with ISO6801 date string properties to an object with proper Date properties
// v Scroll down to see the example first v
// v--------------------------------------v
// a mapped type that is a union of the names of properties of T that are of type string
type OnlyStringProperties<T> = { [Key in keyof T]: T[Key] extends string ? Key : never }[keyof T];
// From an original object of type T, return another object where the properties
// whose name is passed are parsed to Date
function convertStringPropertiesToDates<T, K extends OnlyStringProperties<T>>(
original: T,
@tsimbalar
tsimbalar / README.md
Last active April 20, 2019 21:50
Pino js tool to make raw pino output compatible with Seq / GELF ingestion through docker

This is a small tool that allows transforms logs written with pino in newline-delimited JSON on the standard output to the Compact Log Event Format (CLEF) supported by the Seq logging server.

Typical use case for this is :

  • write your logs with pino how you would normally do it
logger.info({some: 'extra', context:'info'}, 'this is the message');
logger.info({user: 'John', amount:'2345', extra: 'other info'}, '{user} just spent {amount} euros on the website');
@tsimbalar
tsimbalar / InstallWinStuff.ps1
Created August 13, 2015 12:24
Install other windowsy things
dism /Online /Get-Features
@tsimbalar
tsimbalar / devstation.ps1
Last active June 6, 2016 07:41
Boxstarter file for dev station
Disable-InternetExplorerESC
Enable-RemoteDesktop
Enable-MicrosoftUpdate
Install-WindowsUpdate
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
cinst notepadplusplus.install
#cinst git.install
@tsimbalar
tsimbalar / robot.js
Created December 5, 2012 21:39
ThiBOTv1
var lastSeenPositions = []
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
// go straight to the wall
robot.rotateCannon(-40)
//robot.ahead(robot.arenaWidth + robot.arenaHeight);
};
Robot.prototype.onIdle = function(ev) {
@tsimbalar
tsimbalar / robot.js
Created December 5, 2012 15:37
Zolmeister
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (robot.parentId) {
robot.ahead(1);
robot.turnGunRight(1);
}
else {