Skip to content

Instantly share code, notes, and snippets.

View Tuizi's full-sized avatar

Fabien Rogeret Tuizi

  • Montréal, Canada
View GitHub Profile
/**** Utils ****/
.font(@size) {
font-size: @size;
line-height: @size;
}
.size(@width, @height) {
width: @width;
height: @height;
}
@Tuizi
Tuizi / code tips.md
Last active October 2, 2015 19:59
Code tips

#Angular

Binding

"@" ( Text binding / one-way binding )

"=" ( Direct model binding / two-way binding )

"&" ( Behaviour binding / Method binding )

"?" = optionnal (no inheritance from parent scope)

@Tuizi
Tuizi / gulpfile.js
Created October 14, 2015 01:56
Gulp + SCSS + Babel + Watch
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
var sass = require('gulp-sass');
function compile(watch) {

Semver

http://ricostacruz.com/cheatsheets/semver.html

Given a version number MAJOR.MINOR.PATCH:

-MAJOR = incompatible API changes.
-MINOR = add functionality. (backwards-compatible)
-PATCH = bug fixes. (backwards-compatible)

Simple ranges

@Tuizi
Tuizi / jquery ajax lifecycle.md
Last active May 1, 2016 20:32
jQuery - Global Ajax Event Handlers lifecycle

For each call ajax

  1. ajaxStart
  2. ajaxSend
  3. ajaxSuccess/ajaxError
  4. ajaxComplete
  5. ajaxStop
@Tuizi
Tuizi / blackbox.md
Last active November 25, 2019 13:31
Composable component

Blackbox component

// users/edit/index.hbs
{{filter-list
  items=model
  filterBy="path.value"
  labelBy="path.value"
  highlight=true
 order="ASC"}}
@Tuizi
Tuizi / speak.md
Last active October 27, 2016 20:06

English

var msg = new SpeechSynthesisUtterance('Hello! how are you today?');
msg.lang = 'en-US';
window.speechSynthesis.speak(msg);

French

var msg = new SpeechSynthesisUtterance("Bonjour, comment allez vous aujourd'hui?");
@Tuizi
Tuizi / techno stack.html
Last active November 1, 2016 13:53
Techno Stack
<!DOCTYPE html>
<html>
<body>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABUAAAAL1CAYAAAAGpk5zAATYKnpUWHRteEdyYXBoTW9kZWwAALy8x47tSNA09jQDSJsBvVnS89B7t/lB773n04vs+RZaSBsJEnBP39M0xTJZmRGRyf4HZvqrqLv8HwjY13yhynzY/oHZfyBIHZ+66+J/IB79F3hP/29qnNbDNq7VPzD9/v4btrx7/38Pvz91+/0RvB8Q+F8g+L+w//39Sk1Tl/t5Itfb1wqM/wtjX0Oy6KjKPxDzfu/q9nu0kKft+N3CVMvY539X/wv8C+EE+i+IwO8JOy7ipf4/NQO9B498Wetx+K+/6L/4v9C/yH9n8qzexuW/E+d5/pst8flvPf53crun/L9T5TiW39ihf2DuH5jJ6rhc4v79BVeeYJ2DuK0DRCvy6/GqUdz4OCZRk8EAMAD/gejzB6E9nI4r9iiLva87dsGDpd9kSHHOcGPCew36vM/hT9GC08EgvHo20Rj+jjA0bpziZZwszRIIxZ7vQbg2guFWx9ogUFe9PPLIlO8wTi07TuDE2yAPXl7S5YFywNclhhG0pNF71IhKvXi/0AOGE+k7T3SG6gYOxuT7tXovyPKhGQTr/YakbFbNXx/ef8IYQN7yXpOnY1N+XS265zdjCoGi6n+XwE8lcVgSVtg7d/z+fp73U/IMjBLf9QAKE8775SCLArevbvhGIhZiqIQFwAIG9SzD1wusJfDEw5P3LK/tBYY377c7675evJ88/S46vmNlMNGAdNOMfes/9/wZ2NeN98n0Ny6yabL1+Osbbb4rylMgdBTnMgiF8a4+302gAcotOVz5DGSQPT3t4nAr6I3aezZ4R0ULWQRiEnJsOiFhG9GaX5c31Xh/ptj0XnC/nyLDWwH0Di3fv9Nl2kTF9Q6dvt7P/HyNWe1DFrbtXP5BsEhDEJfYXguO0EAViLOX0Df7XC71Nf
@Tuizi
Tuizi / test-helper.spec.ts
Last active March 19, 2021 19:47
MockStore for Angular ngrx/store unit tests
import { Action, ActionReducer, Store } from '@ngrx/store';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';
import { map } from 'rxjs/operator/map';
import { Observer } from 'rxjs/Observer';
// TODO: How to initialize those variables?
const dispatcherMock: Observer<Action>,
reducerMock: Observer<ActionReducer<any>>,
stateMock: Observable<any>;
@Tuizi
Tuizi / app.module.ts
Last active September 21, 2017 14:12
ngx-translate multiple i18n files
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/app/', '.json');
}
@NgModule({
imports: [
/* ... */
HttpClientModule,
TranslateModule.forRoot({
loader: {