Skip to content

Instantly share code, notes, and snippets.

View jochy's full-sized avatar

Alex Dubois jochy

View GitHub Profile
@jochy
jochy / main.dart
Created December 11, 2022 16:33
dart-node-correction
void main() {
var root = Node(
value: 3,
left: Node(value: 2, left: Node(value: 1)),
right: Node(value: 5, left: Node(value: 4), right: Node(value: 10)),
);
print(root.find(3));
print(root.find(1));
print(root.find(11));
@jochy
jochy / main.dart
Created December 11, 2022 16:25
dart-node
void main() {
/*
* 1) Créez une classe Nommée Node, qui possède 3 attributs :
* Left : un Node, optionnel
* Right : un Node, optionnel
* Value : un int
*
* 2) Créez un arbre à l'aide de la classe Node et plusieurs instances.
* Représentez l'arbre ci-dessous :
* 3
@jochy
jochy / webpack.main.config.js
Created September 3, 2022 15:42
Electron webpack and nodegit
const webpack = require('webpack');
const {ModifySourcePlugin} = require('modify-source-webpack-plugin');
const {ModificationType} = require("modify-source-webpack-plugin/build/ModifySourcePlugin");
module.exports = {
mode: 'production',
entry: {
main: './main.js',
},
resolve: {
@jochy
jochy / Deploy using ssh and docker-compose.md
Last active July 23, 2024 15:03
[Ubuntu] Deploy a docker-compose from Github Actions using SSH

1. Create SSH keypair

In order to deploy using SSH, we need a SSH keypair. Please use an algorithm strong enough and also supported by GHA and your remote host.

You can use the command below to generate a keypair:

ssh-keygen -t ed25519 -C gha@vm-YourLogin -f ~/.ssh/id_gha

For this use case, don't use a passphrase (just type Return to select an empty passphrase).