Skip to content

Instantly share code, notes, and snippets.

#include<bits/stdc++.h>
using namespace std;
// please not at any time we will keep elements in the map called mp whose index lie between i to j.
// Initially both are 0 so only first element is added in the map
int solution(int a[], int n)
{
set<int> st; // to store all the elements to find number of unique elements
for(int i = 0; i < n; i++){
@Abiwax
Abiwax / mappage.css
Created January 27, 2018 19:05
Mappage
#mapSection {
height: 100%;
position: absolute;
width: 100%;
}
.card{
padding: 10px;
@Abiwax
Abiwax / mappage.ts
Created January 27, 2018 19:04
Map Page
job: Job;
user_location: any;
error_message: string;
constructor(public jobget: JobSetGetService, public router: Router, public apiProvider: ApicallsService) {
}
// Initialize Components
ngOnInit() {
this.job = this.jobget.jobInfo;
@Abiwax
Abiwax / form.html
Created January 27, 2018 18:55
forms
<form #jobSearchForm="ngForm" (ngSubmit)="formSubmit()">
<div class="form-group">
<label for="search">Job Title</label>
<input type="text" class="form-control" id="search"
[(ngModel)]="model.search" required name="search"
#name="ngModel">
</div>
<div class="form-group">
<label for="location">Location</label>
@Abiwax
Abiwax / mappage.html
Created January 27, 2018 18:42
mappage
<div class="row">
<div id="mapSection">
</div>
<div class="card">
<div class="card-block">
<h4 class="card-title">{{job.title}}</h4>
<h6 class="card-subtitle mb-2 text-muted">{{job.company}} | {{job.date}} | <span class="money"><i
class="fa fa-money" aria-hidden="true" style="color: green;"></i>{{job.salary}}</span></h6>
<p class="card-text">{{job.description}}</p>
<div class="row bottom_info">
@Abiwax
Abiwax / homepage.ts
Created January 27, 2018 18:41
homepage.ts
// go to map page
goToMap(job: Job) {
this.jobset.jobInfo = job;
this.router.navigate(['map']);
}
// On form submit
formSubmit() {
this.apiProvider.getCareerJetResults(this.model.search, this.model.location)
.subscribe((jobs) => {
@Abiwax
Abiwax / card.html
Created January 27, 2018 18:35
Card Sample
<div class="card" (click)="goToMap(job)">
<div class="card-block">
<h4 class="card-title">{{job.title}}</h4>
<h6 class="card-subtitle mb-2 text-muted">{{job.company}} | {{job.date}} | <span class="money"><i
class="fa fa-money" aria-hidden="true" style="color: green;"></i>{{job.salary}}</span></h6>
<p class="card-text">{{job.description}}</p>
<div class="row bottom_info">
<span><i class="fa fa-map-marker" aria-hidden="true" style="color: red;"></i>{{job.locations}}</span>
<span class="url_link" style="right: 0"><a href="{{job.url}}" target="_blank" class="card-link"><i
class="fa fa-link" aria-hidden="true"></i></a></span>
ngOnInit() {
if (this.jobset.jobs.length < 1) {
this.apiProvider.getCareerResults('', 'Halifax, NS')
.subscribe((jobs) => {
this.jobset.jobs = jobs;
this.jobs = this.jobset.jobs;
},
(error) => {
this.error_message = <string>error;
});
@Abiwax
Abiwax / APICallService.ts
Created January 27, 2018 17:41
APICallService
places_url = '/googleplaces';
matrix_url = '/distancematrix';
constructor(public http: Http) {
}
// make a http call to careerjet public API and return and return an observable
getCareerJetResults(search, location): Observable<Job[]> {
@Abiwax
Abiwax / app.js
Created October 4, 2017 23:52
Node MySQL connection
var mysql = require('mysql');
var express = require('express');
var app = express();
var connection = mysql.createConnection({
host : "localhost",
user : "username",
password: "yourpassword",
database: "Example"
});