Skip to content

Instantly share code, notes, and snippets.

View marc-x-andre's full-sized avatar
🌿

Marc-André Daigneault marc-x-andre

🌿
View GitHub Profile
###
# My custom ZSH for "Git for Windows"
# ⌚ 12:43 - ⚡ v16.16.0 - 📂 ~/repo/dotfiles
# ➜
# Doc used: https://blog.carbonfive.com/writing-zsh-themes-a-quickref/
##
precmd() {
psvar[1]="v?.?.?"
if which node &> /dev/null; then
@marc-x-andre
marc-x-andre / Template_v2.vue
Created November 2, 2022 13:13
VueJs 2 Component Template
<template>
<div class="main-component-class">
...
</div>
</template>
<script>
// Library import
import { mapActions, mapGetters } from 'vuex'
// Local script import
@marc-x-andre
marc-x-andre / event_emitter.py
Created June 26, 2020 21:23
A event emitter in Python
from typing import Dict
class EventEmitter:
def __init__(self):
self._callbacks: Dict[str, callable] = {}
def on(self, event_name, function):
self._callbacks[event_name] = self._callbacks.get(event_name, []) + [function]

Keybase proof

I hereby claim:

  • I am the224 on github.
  • I am the224 (https://keybase.io/the224) on keybase.
  • I have a public key ASA5gazJZ0StatSyhjTGqOsgCVHOAIZnmOhxyNSyZFf3Ewo

To claim this, I am signing this object:

@marc-x-andre
marc-x-andre / auto-destroyer.ts
Created March 25, 2019 14:45
Auto unsubscribe from every Rxjs subcription inside a component
export function AutoOnDestroy(blackList = []) {
return function (constructor: any) {
const original = constructor.prototype.ngOnDestroy;
constructor.prototype.ngOnDestroy = function () {
for (const prop in this) {
if (this.hasOwnProperty(prop)) {
const property = this[prop];
if (!blackList.includes(prop)) {
if (property && (typeof property.unsubscribe === 'function')) {
@marc-x-andre
marc-x-andre / cors-tester.html
Created January 18, 2019 16:44
Small `Get` Url tester for CORS policy testing
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CORS Tester</title>
<script>
sendRequest = () => {
@marc-x-andre
marc-x-andre / .Builder
Created November 9, 2017 15:50
Java Builder (Design Pattern) [French/Français]
Java Builder (Design Pattern) [French/Français]
@marc-x-andre
marc-x-andre / .Command
Created November 9, 2017 14:27
Java Command (Design Pattern) [French/Français]
Java Command (Design Pattern) [French/Français]
@marc-x-andre
marc-x-andre / .Observer
Created November 9, 2017 14:24
Java Observer (Design Pattern) [French/Français]
Java Observer (Design Pattern) [French/Français]
@marc-x-andre
marc-x-andre / .Template Method
Created November 9, 2017 14:21
Java Template Method (Design Pattern) [French/Français]
Java Template Method (Design Pattern) [French/Français]