Skip to content

Instantly share code, notes, and snippets.

View KerberosMorphy's full-sized avatar
🐍
Pythoning

Benoit Verret KerberosMorphy

🐍
Pythoning
View GitHub Profile
@KerberosMorphy
KerberosMorphy / Readme.md
Created March 15, 2022 21:26
Tests avec Pytest

Tests avec Pytest

Installer Pytest

pip install pytest

Exécuter les tests

@KerberosMorphy
KerberosMorphy / shared_ssh.md
Last active December 19, 2022 16:22
Partager Clef SSH entre Windows et WSL

Partager Clef SSH entre windows et WSL2

Ouvrir votre distro, et créer ou modifier le fichier /etc/wsl.conf pour inclure les options automount suivant:

[automount]
options = "metadata,umask=022,fmask=111"

Ces options garantissent que les fichiers du système monté reçoivent la propriété de l'utilisateur et du groupe appropriés, et qu'ils disposent d'autorisations par défaut raisonnables (par opposition à ce que toutes obtiennent 777).

@KerberosMorphy
KerberosMorphy / TM_PR_commit_navigation.js
Last active July 9, 2021 18:22
Bitbucket PR commits navigation
// ==UserScript==
// @name Bitbucket PR commits navigation
// @namespace https://github.com/KerberosMorphy
// @source https://gist.github.com/KerberosMorphy/a6b9cbc472aa1a3d2310245d460476b9
// @version 0.1
// @description Bitbucket PR commits navigation
// @author Benoit Verret
// @match https://bitbucket.dimonoff.com/projects/*/repos/*/pull-requests/*/diff
// @match https://bitbucket.dimonoff.com/projects/*/repos/*/pull-requests/*/commits/*
// @icon https://www.google.com/s2/favicons?domain=dimonoff.com
@KerberosMorphy
KerberosMorphy / shared_ssh.md
Last active January 5, 2021 14:37
Création d'une clef SSH partagé Windows/WSL

Création d'une clef SSH partagé Windows/WSL

Important, la création de la clef SSH doit être fait depuis PowerShell

Depuis PowerShell:

> ssh-keygen -t ed25519 -C "YOU_USER@example.com"
@KerberosMorphy
KerberosMorphy / DataSet.py
Last active November 24, 2020 17:29
Class to sync data with S3 Bucket
from glob import iglob
from pathlib import PurePath
from os import mkdir, makedirs
from os.path import isfile, isdir
from typing import Any, Dict, Optional, List
from tqdm import tqdm
from boto3.session import Session as AWSSession
BUCKET_NAME: str = ''
@KerberosMorphy
KerberosMorphy / configs.policies.allowed-plugins.js
Created August 28, 2020 16:14
Serverless Safeguards Custom Policy
'use strict';
module.exports = function allowedPluginsPolicy(policy, service, allowedPlugins) {
let failed = false;
const pluginNames = service.compiled['serverless-state.json'].service.plugins || [];
for (const [i, plugin] of pluginNames.entries()) {
if (allowedPlugins.indexOf(plugin) == -1) {
policy.fail(
`Plugin name "${plugin}" not in list of permitted plugins: ${JSON.stringify(allowedPlugins)}`
);
@KerberosMorphy
KerberosMorphy / ConvertGitHubAction.md
Created August 26, 2020 17:42
Convert GitHub Action

Convert GitHub Action

IMPORTANT: Only Docker base action can be convert and GitHub Action outputs are not convertible.

  • Found action on GitHub Marketplace;

  • Go to the repository and search for action.yml;

  • runs key must be using 'docker':

    runs:
@KerberosMorphy
KerberosMorphy / build_actions.tmpl
Created May 26, 2020 16:00
Terraform CodePipeline Dynamic Stages and Actions
${jsonencode([
{
"name": "Build",
"category": "Build",
"owner": "AWS",
"provider": "CodeBuild",
"input_artifacts": ["SourceArtifact"],
"output_artifacts": ["BuildArtifact"],
"version": "1",
"configuration": {
!(function () {
function e(t, n, r) {
function i(a, l) {
if (!n[a]) {
if (!t[a]) {
var d = "function" == typeof require && require;
if (!l && d) return d(a, !0);
if (o) return o(a, !0);
var s = new Error("Cannot find module '" + a + "'");
throw ((s.code = "MODULE_NOT_FOUND"), s);

SCSS

Exemple de code

Exemple code html :

<div class="patate">
  <ul>
    <li>
      <span class="frite-chaud">Bla</span>
 <span class="frite-froid">Bla Bla</span>