Skip to content

Instantly share code, notes, and snippets.

View YonathanMeguira's full-sized avatar
🤩
Happy

Yonathan Meguira YonathanMeguira

🤩
Happy
View GitHub Profile
@YonathanMeguira
YonathanMeguira / instructions.txt
Created February 25, 2018 14:00
instructions for Monday 26/02/2018
1) add a button " Visibility Point Query"
click on this button should :
-disable the tilting and orbit controls of the scene
- capture any click on the screen and only draw the last clicked point
- transform window x, y to world coordinates
- the button is inversed to "Query visibility", click on this button sends the last clicked point to the server and shows a loader
2) add a button "Path Visibility"
clicking on this button has the same effect as previously but:
all points are drawn onto the scene, need to link the points between them, (draw vectors by couples of {x, y}), if the first couple and the last couple (last clicked point)
@YonathanMeguira
YonathanMeguira / buttons.css
Created February 20, 2018 12:21
cool buttons
/* orange to red buttons with animation on hover */
.warm-btn{
padding: 10px 20px;
font-weight: 600;
color: #ff386a;
border: solid 1px #ff386a;
text-transform: uppercase;
font-size: 0.9em;
background-color: transparent;
@YonathanMeguira
YonathanMeguira / app.component.ts
Created January 31, 2018 12:39
add the interceptor
import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core';
import { HTTPStatus } from './services/RxJS/HTTPListener.service';
declare var bodymovin: any;
@Component({
selector: 'app-root',
template: `<div [hidden] = !HTTPActivity`,
styleUrls: ['./app.component.css']
})
export class AppComponent {
/* Angular Modules */
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { AppComponent } from './app.component';
@YonathanMeguira
YonathanMeguira / interceptor.ts
Created January 31, 2018 12:31
http interceptor
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import {
HttpEvent,
HttpHandler,
HttpInterceptor,
HttpRequest
} from '@angular/common/http';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
<div *ngFor="let element of myArray; let idx = index">
<input name="someName" [(ngModel)] = "myArray[idx]">
</div>
<div *ngFor="let element of myArray">
<input name="someName" [(ngModel)] = "element">
</div>
@YonathanMeguira
YonathanMeguira / ngFor.ts
Created October 23, 2017 19:35
ngModel and ngFor
export class SomeClass {
public myArray = ['First Item', 'Second Item', 'Third Item'];
}
@YonathanMeguira
YonathanMeguira / allGroups.json
Created August 8, 2017 07:36
All Groups JSON forms, includes Devices, appliances and links
[
{
"id": 1,
"name": "group1",
"desc": "description1",
"devices": [
{
"type": "device1",
"healthy": false,
"appliances": [
import {Component, OnInit} from '@angular/core';
import {Monsters} from './monsters';
@Component({
selector: 'monsters',
templateUrl: './monsters.component.html',
styleUrls: ['./monsters.component.css']
})
export class MonstersComponent implements OnInit {