Skip to content

Instantly share code, notes, and snippets.

View willgm's full-sized avatar

William Grasel willgm

View GitHub Profile
@willgm
willgm / william_grasel_social_resume.md
Last active May 1, 2018 18:12
William Grasel Social Resume

William Grasel Social Resume

Bio

I'm a Web Developer for ~15 years, and during the last 6 years I have been working in several SPA and PWA projects in a big diversity of frameworks, such as Backbone, React and mainly Angular (1.x and 2+), which gave me a rich FrontEnd experience. I have always been close to the BackEnd as well in several platforms, such as NodeJS, Java and .NET, although FrontEnd and JavaScript will always be my preference. I am involved with IT and Open Source communities for a few years, where I began to share my knowledge in talks, organizing meetups and conference tracks.

Community Organization

AngularSP - Meetup Coordinator

@willgm
willgm / app.component.spec.ts
Created September 4, 2017 21:35
Speed up your component's test suite by caching the test module
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { setUpCachedTestBed } from '../test-utils';
describe('AppComponent', () => {
setUpCachedTestBed({
declarations: [ AppComponent ],
});
beforeEach(() => {
@willgm
willgm / angular-router-spinner.ts
Created August 22, 2017 18:33
Spinner no carregamento de uma rota no Angular 2+
import { Component } from '@angular/core';
import { Router, NavigationStart, NavigationEnd } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['../assets/styles/index.sass'],
})
export class AppComponent {
constructor(
- Backbone Ember Angular 2+ React+Flux
Template System Handlebars Handlebars Angular Syntax JSX
Conventions Too Flexible Strong Conventions Strong Conventions Small Conventions
Main Ecosystem Distributed Built-in Built-in Distributed
Community Libs Strong, decreasing Strong Medium, increasing Strong
Popularity Low, decreasing Low High High
Maturity High High High High
Active Development Low High High High
Community Experience Low, decreasing Low Medium, increasing High
@willgm
willgm / context.directive.ts
Last active January 19, 2017 19:30
creating template variable contexts
import { Directive, Input, ViewContainerRef, TemplateRef, EmbeddedViewRef } from '@angular/core';
@Directive({selector: '[context]'})
export class ContextDirective {
private view: EmbeddedViewRef<any>;
@Input() set contextFrom(context) {
if (!this.view) {
this.view = this.viewContainer.createEmbeddedView(this.template);
[1, 10, 100, 10000, 1000000, 100000000, 1000000000]
.forEach(size => {
console.log('with', size)
console.time('var');
for (var i = 0; i < size; i++) {}
console.timeEnd('var')
console.time('let');
for (let i = 0; i < size; i++) {}
@willgm
willgm / cloudSettings
Last active June 19, 2018 17:05
Visual Studio Code Sync Settings GIST
{"lastUpload":"2018-06-19T17:05:00.761Z","extensionVersion":"v2.9.2"}
function mostFrequentIn(array) {
const score = array.reduce((m, i) => m.set(i, (m.get(i) || 0) + 1), new Map);
return Array.from(score)
.reduce(
(r, [key, val]) => val > r.val ? {key, val} : r,
{key: '', val: 0}
);
}
||paywall.estadao.com.br^
||estadao.com.br/paywall/*
||www1.folha.uol.com.br/folha/furniture/paywall/*
||static.folha.com.br/paywall/*
||static.folha.uol.com.br/paywall/*
||oglobo.globo.com/servicos/inc/payWall.Conteudo.js
||oglobo.globo.com/plataforma/js/*/minificados/paywall/registraConteudosLidos.js
||static.folha.uol.com.br/library/jquery/1.8.3/*
@@|http://www1.folha.uol.com.br/paywall/adblock.shtml?$document
@@*paywall/js/1/publicidade.ads.js
var person = {
name: 'Homer Simpson',
address: {
street: '123 Fake St.',
city: 'Springfield'
}
};
//Complete Imperative
if (person != null && person['address'] != null) {