Skip to content

Instantly share code, notes, and snippets.

View smaillns's full-sized avatar

Smail LOUNES smaillns

View GitHub Profile
@smaillns
smaillns / product-gallery.component.ts
Created July 10, 2020 19:23
Pretty simple Image gallery in angular
<!-- index.html -->
<!doctype html>
<head>
...
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=visualization"></script>
</head>
<!-- component.html -->
<google-map [options]="mapOptions" width="100%">
<map-marker
*ngFor="let spot of spots"
[position]="{ lat: spot.lat, lng: spot.lng }"
[options]="markerOptions"
[clickable]="true"
(mapClick)="selectMarker(spot)"
></map-marker>
</google-map>
// component.ts
myLatLng = { lat: 48.829677, lng: 2.239609 };// Map Options
mapOptions: google.maps.MapOptions = {
center: this.myLatLng,
zoom: 10,
};
markerOptions: google.maps.MarkerOptions = { icon: 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi-dotless.png' };
// component.ts
myLatLng = { lat: 48.829677, lng: 2.239609 }; // Map Options
mapOptions: google.maps.MapOptions = {
center: this.myLatLng,
zoom: 10,
};
markerOptions: google.maps.MarkerOptions = {};
<!-- component.html -->
<google-map [options]="mapOptions" width="100%">
<map-marker *ngFor="let spot of spots"
[position]="{ lat: spot.lat, lng: spot.lng }"
[options]="markerOptions"></map-marker>
</google-map>
@smaillns
smaillns / Pipfile
Last active December 31, 2021 23:42
Pipefile
[packages]
nameko = "==3.0.0-rc9"
nameko-sqlalchemy= "==1.5.0"
alembic = "==1.6.5"
marshmallow= "==2.19.2"
sqlalchemy= "==1.4.22"
psycopg2-binary= "==2.9.1"
[dev-packages]
pytest= "==4.5.0"
@smaillns
smaillns / models
Created January 1, 2022 00:01
SQLALchemy models
import datetime
import enum
from sqlalchemy import (Column, DateTime, ForeignKey, Integer, String, Enum)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
class GenderEnum(enum.Enum):
Male = 'Male'