Skip to content

Instantly share code, notes, and snippets.

View evan-boissonnot's full-sized avatar
🏠
Working from home

Evan BOISSONNOT evan-boissonnot

🏠
Working from home
View GitHub Profile
@evan-boissonnot
evan-boissonnot / git_commands.sh
Created July 27, 2020 12:21 — forked from olegafx/git_commands.sh
Useful git commands
# Save branch history and revert easily
git merge --no-ff
git revert -m 1 <hash>
# Show n lines of context around diff lines instead of the usual +/- 3
git diff -U<n>
# Check which branches are merged
git branch --merged
@evan-boissonnot
evan-boissonnot / es2020 - dynamic import
Last active July 14, 2020 12:57
Dynamic import a module (a js file)
async function launch() {
const { crier } = await import('./testImportFile.js');
crier();
}
launch();
---- testImportFile.js
export function crier() {
console.log('roaaarrrr !');
const unWookie2 = {
prenom: 'Chewie',
nbPoils: 14789963201456n,
nbShampoings: BigInt('9007199254740991'),
arme: {
tirer: function() {
appDiv.innerHTML += ' <b>shot</b>';
}
}
const unWookie = {
prenom: 'Chewie'
}
unWookie.arme?.tirer();
const unWookie2 = {
prenom: 'Chewie',
arme: {
tirer: function() {
let firstName = null;
let lastName = null;
let nickName = 'Chewie';
let result = `${firstName ?? lastName ?? nickName}`;
// Write Javascript code!
const appDiv = document.getElementById('app');
appDiv.innerHTML = `<h1>${result}</h1>`;
@evan-boissonnot
evan-boissonnot / introrx.md
Created June 11, 2020 15:38 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@evan-boissonnot
evan-boissonnot / jshipster_and_and.js
Created December 3, 2019 23:33 — forked from berzniz/jshipster_and_and.js
Some small javascript hacks for hipsters
// Boring
if (isThisAwesome) {
alert('yes'); // it's not
}
// Awesome
isThisAwesome && alert('yes');
// Also cool for guarding your code
var aCoolFunction = undefined;
@evan-boissonnot
evan-boissonnot / angular.json
Created October 2, 2019 05:22
Updating angular.json for ie11
"es5": {
"tsConfig": "./tsconfig.app.es5.json"
}
@evan-boissonnot
evan-boissonnot / list-buttons.component(4).ts
Created September 10, 2019 21:32
Manage dynamic loading component on clic
import { Component, OnInit, ViewChild, ComponentFactoryResolver, ViewContainerRef } from '@angular/core';
import { Droide } from '../droide';
import { DroideService } from '../droide.service';
import { LandingZonaDirective } from '../landing-zona.directive';
import { state } from '@angular/animations';
@Component({
selector: 'app-list-buttons',
templateUrl: './list-buttons.component.html',
styleUrls: ['./list-buttons.component.css']
@evan-boissonnot
evan-boissonnot / list-buttons.component(3).ts
Created September 10, 2019 21:15
Manage click on button
import { Component, OnInit } from '@angular/core';
import { Droide } from '../droide';
import { DroideService } from '../droide.service';
@Component({
selector: 'app-list-buttons',
templateUrl: './list-buttons.component.html',
styleUrls: ['./list-buttons.component.css']
})
export class ListButtonsComponent implements OnInit {