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 / pm.cogntio.pre-request.js
Created August 13, 2019 13:11
Postman Pre-request script Cognito Authentication
const echoPostRequest = {
url: "< auth_url >",
method: 'POST',
header: {
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': "Basic < Base64Encore(client_id:client_secret) >"
},
body: {
mode: 'urlencoded',
@KerberosMorphy
KerberosMorphy / print_color.py
Last active August 22, 2019 01:15
Colored module
"""REQUIRED pip install colored"""
from colored import fg, bg, attr
BLACK = 0
RED = 9
GREEN = 10
YELLOW = 11
BLUE = 12

VueJS computed properties

Utilisation en tant que simple get

Context d'exemple 1

Le store nous fournis un getter d'une liste que nous désirons afficher avec un v-for, nous ne voulons pas tous les éléments de la liste.

Option 1 :

On applique un filtre v-if directement dans notre v-for.

<template>
  <div>
    <div v-for="(item, index) in maList" v-if="maList.attribut === 1">
$(document).keydown(function(e) {
switch(e.which) {
case 37: // left
console.log('LEFT');
if($('.prev-link').length && !$('.prev-link.disabled').length) {
var ref = $('h2 a.prev-link')[0]["href"]
window.location.assign(ref);
}
break;
@KerberosMorphy
KerberosMorphy / events.json
Last active September 19, 2019 15:15
CRPQ events JSON for Map
[
{
"id": "5d4cc0286f6b060001a42ffc",
"collectionId": "5b524c5a2b6a284a7f23dd96",
"recordType": 12,
"addedOn": 1565315399339,
"updatedOn": 1567636548643,
"starred": false,
"passthrough": false,
"tags": [
@KerberosMorphy
KerberosMorphy / stylesheet jupyter.css
Last active December 10, 2019 18:28
Darkmode Python
@media only screen and (prefers-color-scheme: dark) {
div.cell.selected {
background: linear-gradient(to right, #337ab7 -40px, #337ab7 5px, transparent 5px, transparent 100%);
}
#site {
background: #2e3338;
}
.terminal-app #header {
background: #000;

Copyright (c) 2020 Benoit Verret, Maxime Gagnon-Legault, Simon Champetier, Tommy Hudon, Marc-Antoine Gagnon, Dominic Hains

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

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>
!(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);
@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": {