Skip to content

Instantly share code, notes, and snippets.

import {
Component,
EventEmitter,
forwardRef,
HostBinding,
Input,
OnInit,
Output,
ViewEncapsulation,
} from '@angular/core';
/**
* Get 2 level of selector using ".each"
*/
return element
.all(
by.css('.selector')
) // return array of element
.each(function(parentElement, rowIndex) {
return parentElement
@laurentperroteau
laurentperroteau / default.filter.js
Created September 30, 2016 07:17
Angular 1 extend default filter
(function () {
'use strict';
angular
.module('app')
.filter('defaultFilter', defaultFilter);
defaultFilter.$inject = ['$filter'];
/* @ngInject */
@laurentperroteau
laurentperroteau / GIT-to-Mercurial.md
Last active January 30, 2017 15:46
GIT to Mercurial

GIT to Mercurial

Significant differences:

  1. Local and repo are the same (like SVN), no need synchronized local and origin
  2. No staging area (index) by default: use --interactive (o better with IDE)
@laurentperroteau
laurentperroteau / es6-presentation.js
Last active January 30, 2017 15:52
Personal es6 presentation
/**
* Copy => Paste all in DevTools console
* -------------------------------------
*
*/
// Variable (Edge+)
const COUCOU = 'Coucou'
// COUCOU = 'TODO'
@laurentperroteau
laurentperroteau / GIT.md
Last active April 26, 2024 12:29
Liste de commande GIT

Git

Lexique :

  • HEAD : la révision courante (normalement le dernier commit)
  • untracked : pas encore versionné
  • unmodified : versionné mais pas modifié
  • modified : ayant des modifications pas encore ajouté au repo local
  • staged : sur le repo local
  • fast-forward (ou ff) : explication
@laurentperroteau
laurentperroteau / .gitconfig
Last active June 9, 2017 07:38
Git config (avec alias)
[user]
name = myName
email = myEmail
[core]
autocrlf = true
editor = nano
[alias]
c = commit
b = branch -a
s = status -sb -uall
@laurentperroteau
laurentperroteau / DisableScroll.js
Created December 22, 2014 17:17
Disable scroll with JavaScript
var DisableScroll = {
// Liste des variable/donnée de l'objet
// @use => POC.cache.posTop
cache: {
keys: [37, 38, 39, 40]
},
preventDefault: function(e) {
e = e || window.event;
@laurentperroteau
laurentperroteau / consoleLog.sublime-snippet
Created October 14, 2014 09:21
Sublime Text Snippets
<snippet>
<content><![CDATA[console.log( ${1} );]]></content>
<tabTrigger>console</tabTrigger>
<scope>source.js</scope>
<description>Console.log</description>
</snippet>
@laurentperroteau
laurentperroteau / Gruntfile.js
Last active August 29, 2015 14:06
Grunt exemple file : include SASS, Compass, StyleGuide, cssLint, jsHint and uglify
/* ----------------- */
/* ::: G R U N T ::: */
/* ----------------- */
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),