Skip to content

Instantly share code, notes, and snippets.

View matheusmurta's full-sized avatar
👨‍💻
Focusing

Matheus Gonçalves Murta matheusmurta

👨‍💻
Focusing
View GitHub Profile
@matheusmurta
matheusmurta / Javascript get string after last slash
Last active May 29, 2020 18:08
Javascript get string after last slash
let str = "http://localhost:8086/#/menu/user"
let index = str.lastIndexOf("/");
result = str.substr(index+1); //result "user"
or
let last = str.split("/").pop();
@matheusmurta
matheusmurta / Javascript ordem alfabetica do array
Last active May 19, 2020 16:57
Javascript ordem alfabetica do array
//Javascript ordem alfabetica do array
var objArray = [];
objArray.push({Id: 1, DepartmentName: 'ZMarketing', Active: true});
objArray.push({Id: 2, DepartmentName: 'Sales', Active: true});
objArray.push({Id: 3, DepartmentName: 'Development', Active: true});
objArray.push({Id: 4, DepartmentName: 'Accounting', Active: true});
objArray.sort(function(a, b) {
var textA = a.DepartmentName.toUpperCase();
var textB = b.DepartmentName.toUpperCase();
@matheusmurta
matheusmurta / Javascript extract especif information from objects array.js
Created May 19, 2020 04:26
Javascript extract especif information from objects array
//Javascript extract especif information from objects array
var array = [ {"name":"Joe", "age":17, "sex":"M"},{"name":"Bob", "age":17, "sex":"M"},{"name":"Carl", "age": 35, "sex":"M"}];
array.map(x => ({
label: x.name,
value: x.age
}));
AngularJS
https://dncmagazine.blob.core.windows.net/downloads/AngularCheatSheet-DNCMagazine.pdf
Angular
https://github.com/sudheerj/angular-interview-questions
@matheusmurta
matheusmurta / sass-7-1-pattern.scss
Created February 21, 2020 13:21 — forked from rveitch/sass-7-1-pattern.scss
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@matheusmurta
matheusmurta / npm-commands.md
Created February 19, 2020 16:06 — forked from ankurk91/npm-commands.md
Useful npm commands and tricks

npm v3.10 - ◾

If you are learning npm then i would suggest to go for yarn, dont waste your time in learning npm

⚠️ This gist is outdated, but most of the commands are still relevant.

Update npm itself

npm install -g npm
# Downgrade to a specific version
@matheusmurta
matheusmurta / gist:6932860c0ed1f33d0b90aff7103aa84f
Last active February 15, 2020 22:39
Multi level hierarchy control UI inspiration
https://dribbble.com/shots/3504343-Multi-level-dropdown
https://cdn.dribbble.com/users/283116/screenshots/4926970/dribbble-2.png
https://dribbble.com/shots/5281637-Tree-list-hierarchy/attachments
https://dribbble.com/shots/4472000-Packaging-Hierarchy
https://dribbble.com/shots/5286010-Sitemappin/attachments
https://dribbble.com/shots/4069573-New-Hierarchy-Lines-in-Nima
https://dribbble.com/shots/5528112-Bank-Commercial-Porfolio-My-Portfolio
https://dribbble.com/shots/6764154-Hierarchy-Builder-Search-Bar
https://dribbble.com/shots/4409160-Flow-Chart
https://cdn.dribbble.com/users/1256139/screenshots/6497090/dribbble3.png
@matheusmurta
matheusmurta / gist:d7cf87cab7dedee3a2699cf5f35fe0e6
Created February 10, 2020 16:30
Angular send ng-template to component
//your component
<div *ngTemplateOutlet="template"></div>
@Input() template :TemplateRef<any>;
//your module
<ng-template #loading>
<div>Loading...2</div>
</ng-template>
@matheusmurta
matheusmurta / Query Selector in Angular
Created February 6, 2020 17:29
Query Selector in Angular
constructor(private renderer: Renderer, private elem: ElementRef){}
ngAfterViewInit(){
// you'll get your through 'elements' below code
let elements = this.elem.nativeElement.querySelectorAll('.classImLookingFor');
}