This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyController { | |
constructor($scope, $rootScope) { | |
/* | |
Every $rootScope.$on returns a deregistration function that remove listerner and avoid duplications | |
https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$on | |
*/ | |
const deregisterDropdownOpenEvent = $rootScope.$on('DropdownOpened', () => console.log('dispatch event')) | |
/* Deregister function on scope $destroy event (when user leave the page, for example) */ | |
$scope.$on('$destroy', () => deregisterDropdownOpenEvent()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- 'node' # use latest stable nodejs version | |
before_script: | |
- npm install | |
- npm run test | |
- npm run coverage | |
script: | |
- npm run build # jest test with coverage flag does coverage too | |
after_script: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"extends": [ | |
"tslint:latest", | |
"tslint-config-prettier" | |
], | |
"rules": { | |
"no-any": false, | |
"ordered-imports": false, | |
"semicolon": [true, "always"], | |
"member-ordering": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import Channel from '@nodeguy/channel' | |
const ch = Channel() | |
export class Generators { | |
static async waitAndRetrieve() { | |
const r = await ch.shift() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init(): void { | |
this.handleOnReceiveMessage = this.onReceiveMessage.bind(this) | |
window.addEventListener('message', this.handleOnReceiveMessage) | |
} | |
onReceiveMessage(message: MessageEvent) { | |
const action = message.data | |
switch(action) { | |
case 'a': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SelfDriving(classFn: Function) { | |
classFn.prototype.selfDrivable = true; | |
} | |
@SelfDriving | |
class SomeCar { | |
private make: string; | |
constructor(make: string) { | |
this.make = make; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vue.component('my-component', { | |
props: ['title', 'body'], | |
template: '<h1>Hello World</h1>' | |
}) | |
/** | |
* <my-component></my-component> | |
**/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import products from "./products-data.json"; | |
export class Products { | |
static getProducts() { | |
return new Promise((resolve, reject) => { | |
if (products) { | |
resolve(products); | |
} else { | |
reject(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"v":"5.5.9","fr":25,"ip":0,"op":45,"w":300,"h":265,"nm":"Convidar-membros","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"tampa carta/letter-animation contornos","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":6,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":8,"s":[90]},{"t":11,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[306.993,105.5,0],"ix":2},"a":{"a":0,"k":[101.75,86.75,0],"ix":1},"s":{"a":0,"k":[-102.023,-107.067,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[6.215,-5.515],[0,0],[-4.602,0],[0,0],[-3.093,2.92],[0,0]],"o":[[0,0],[3.092,2.92],[0,0],[4.602,0],[0,0],[-6.211,-5.515]],"v":[[-11.25,-38.938],[-100.833,39.713],[-88.982,44.453],[88.981,44.453],[100.833,39.713],[11.249,-38.938]],"c":true},"ix":2},"nm":"Caminho 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.956862804936,0.831372608858,0.490196108351,1],"i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mkd() { | |
mkdir -p "$@" && cd "$_"; | |
} |