Skip to content

Instantly share code, notes, and snippets.

View dsebastien's full-sized avatar

Sebastien Dubois dsebastien

View GitHub Profile
//CONFIG QUAKE3 ARENA DE PLAYZONE
echo Q3A PLAYZONE CONTROLS 1.0
echo Cree par: PLAYZONE
//PARAMETRES
seta color "1"
seta dynamiclight "1"
seta freelock "1"
// generated by quake, do not modify
unbindall
bind TAB "+scores"
bind ENTER "+button2"
bind ESCAPE "togglemenu"
bind SPACE "quit"
bind + "sizeup"
bind - "sizedown"
bind 0 "weapon 10"
bind 1 "weapon 1"
@dsebastien
dsebastien / indicators-api.ts
Created November 26, 2018 13:09
TS Async await fetch and io-ts
async getIndicatorData(indicator: WorldBankApiV2Indicators, country: Country, dateRange: string, perPage: number): Promise<DataPoint[]> {
const response: Response = await fetch(`${this.getBaseIndicatorApiUrlFor(indicator, country)}?${WorldBankApiV2Params.FORMAT}=${WorldBankApiV2Formats.JSON}&${WorldBankApiV2Params.PER_PAGE}=${perPage}&${WorldBankApiV2Params.DATE}=${dateRange}`);
const checkedResponse: Response = await this.checkResponseStatus(response);
let jsonContent: unknown = await this.getJsonContent(checkedResponse);
const validationResult = worldBankApiV2IndicatorResponseValidator.decode(jsonContent);
ThrowReporter.report(validationResult);
@dsebastien
dsebastien / gist:7722ffbe8cf8ed99aef705d1ed0f73a9
Created August 28, 2019 20:33
ConEmu without/with Git Bash MSYS (MinTTY) / CMD
With MSYS (MinTTY):
set "PATH=%ConEmuDrive%\Program Files\Git\usr\bin;%PATH%" & "%ConEmuDrive%\Program Files\Git\git-cmd.exe" --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe /usr/bin/bash.exe -l -i -new_console:p
With CMD:
set "PATH=%ConEmuDrive%\Program Files\Git\usr\bin;%PATH%" & "%ConEmuDrive%\Program Files\Git\git-bash.exe" --no-cd
One possible approach:
@FacadeClient("LoginPage")
class LoginPage {
onSwitchLanguageClicked() {
this.sessionFacade.switchLanguage(this.selectedLanguage);
}
}
...
@dsebastien
dsebastien / package.json
Created January 31, 2020 11:35
Workbox 5 + Workbox build + TypeScript SW + Webpack build + Angular app
{
...
"scripts": {
"start:web:prod": "npm run build:prod:web && http-server dist/apps/web -d -c-1 -a 0.0.0.0 --proxy http://127.0.0.1:4200? --port 4200",
"start:web:prod:local": "npm run build:prod:web:local && http-server dist/apps/web -d -c-1 -a 0.0.0.0 --proxy http://127.0.0.1:4200? --port 4200",
"build:prod:web": "ng build web --prod",
"postbuild:prod:web": "npm run build:pwa:web",
"build:prod:web:local": "ng build web --prod",
"postbuild:prod:web:local": "npm run build:pwa:web:local",
"build:pwa:web": "rimraf ./dist/apps/web/service-worker.js && webpack --config ./service-worker/webpack.prod.config.js --progress --colors && node ./workbox-build-inject.js",
@dsebastien
dsebastien / machine.js
Last active November 16, 2020 09:15
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
import {Machine, StateSchema} from 'xstate';
// TODO review/improve based on: https://xstate.js.org/docs/guides/typescript.html#using-typescript
/**
* Extended state of the machine (if any)
* Reference: https://xstate.js.org/docs/guides/context.html
*/
// tslint:disable-next-line:no-empty-interface
interface MeetingStateMachineContext {}
import {
ActivatedRoute,
NavigationEnd,
NavigationStart,
Router,
} from "@angular/router";
import { Injectable, OnDestroy } from "@angular/core";
import { ViewportScroller } from "@angular/common";
import { filter, observeOn, scan } from "rxjs/operators";
import { asyncScheduler, Subscription } from "rxjs";
<div>
<div class="main-wrapper">
<header>
...
</header>
<main id="main-content" #mainContent>
<router-outlet class="router-flex" (activate)="onActivate($event)"></router-outlet>
</main>
</div>