Skip to content

Instantly share code, notes, and snippets.

View chriseugenerodriguez's full-sized avatar
👋
yo

Chris Rodriguez chriseugenerodriguez

👋
yo
View GitHub Profile
@chriseugenerodriguez
chriseugenerodriguez / slider.component.scss
Created April 15, 2023 00:04
Slider Directive with Pagination, Mobile Swipe Support
@import "../../../../assets/css/abstracts/_mixins.scss";
@import "../../../../assets/css/abstracts/_variables.scss";
:host {
position: relative;
display: block;
.slider-wrapper {
overflow: hidden;
@chriseugenerodriguez
chriseugenerodriguez / network.interceptor.ts
Created April 14, 2023 23:58
Network Interceptor for Offline Redirect (Angular)
import { Injectable } from '@angular/core';
import {
HttpRequest,
HttpResponse,
HttpHandler,
HttpEvent,
HttpInterceptor
} from '@angular/common/http';
import { Router } from '@angular/router';
@chriseugenerodriguez
chriseugenerodriguez / array-loop.ts
Last active April 14, 2023 23:58
Array Loop for Objects (Angular)
import { PipeTransform, Pipe } from '@angular/core';
@Pipe({ name: 'keys' })
export class KeysPipe implements PipeTransform {
transform(value, args: string[]): any {
let keys = [];
// tslint:disable-next-line:forin
for (let key in value) {
keys.push(key);
}
@chriseugenerodriguez
chriseugenerodriguez / robots.txt
Last active April 14, 2023 23:54
General User Agent List for SiteMap Indexing
################################# ROBOTS.TXT ###################################
# Updates can be retrieved from: https://github.com/jonasjacek/robots.txt #
# This document is licensed with a CC BY-NC-SA 4.0 license. #
# Last update: 2019-03-07 #
################################################################################
Sitemap: (https://website/sitemap.xml)
User-agent: 360Spider
User-agent: 360Spider-Image
User-agent: 360Spider-Video
@chriseugenerodriguez
chriseugenerodriguez / country-bounds.ts
Last active October 5, 2024 19:36
Google Map Country Bounds Javascript
import { Injectable } from '@angular/core';
@Injectable()
export class POIService {
// LEFT, BOTTOM, RIGHT, TOP
private country_bounding_boxes = [
{'AF': {'Afghanistan': [60.5284298033, 29.318572496, 75.1580277851, 38.4862816432]}},
{'AO': {'Angola': [11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998]}},
{'AL': {'Albania': [19.3044861183, 39.624997667, 21.0200403175, 42.6882473822]}},
{'AE': {'United Arab Emirates': [51.5795186705, 22.4969475367, 56.3968473651, 26.055464179]}},
@chriseugenerodriguez
chriseugenerodriguez / social-share.html
Last active September 21, 2018 05:33
Angular / Typescript Social Share - Social Media Sharing without all the bulk from social media sdks.
<ul>
<li>
<a (click)="social('facebook')"><i class="fa fa-facebook"></i></a>
</li>
<li>
<a (click)="social('pinterest')"><i class="fa fa-pinterest"></i></a>
</li>
<li>
<a (click)="social('twitter')"><i class="fa fa-twitter"></i></a>
</li>
@chriseugenerodriguez
chriseugenerodriguez / component.ts
Last active September 16, 2022 13:39
ngx-translate multi-language meta tags
// TRANSLATE
import { TranslateService, LangChangeEvent } from '@ngx-translate/core';
export class Component implements OnInit {
constructor(public meta: Meta, public title: Title, public translate: TranslateService) {}
ngOnInit(): void {
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
this.meta.updateTag(
@chriseugenerodriguez
chriseugenerodriguez / nav.component.html
Last active June 28, 2017 16:35
ngx-translate with localize-router dropdown language change (URL & DOM).
<nav class="__nav-menu">
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}"><a [routerLink]="['/']"> {{ 'Header.HomeLink' | translate }} <span class="sr-only">{{ 'Header.SRCurrent' | translate }}</span></a></li>
</ul>
<form class="navbar-form navbar-left">
<div class="form-group">
<input type="text" class="form-control" placeholder="{{ 'Header.Search' | translate }}">
</div>
<button type="submit" class="btn btn-default">{{ 'Header.SubmitBtn' | translate }}</button>