Skip to content

Instantly share code, notes, and snippets.

View dizco's full-sized avatar

Gabriel dizco

View GitHub Profile
# Add accept all self signed certificates
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
@dizco
dizco / app.component.ts
Last active December 31, 2021 06:13
Ngx-Admin and Nebular menu translation. Supports nested menu items and live reload
/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { Component, OnInit } from '@angular/core';
import { AnalyticsService } from './@core/utils/analytics.service';
import { TranslateService } from '@ngx-translate/core';
@Component({
@dizco
dizco / fullcalendar.component.ts
Created August 2, 2018 07:19
Implementation of FullCalendar in TypeScript, inspired by https://github.com/akveo/ngx-admin/pull/1774
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
import * as $ from 'jquery';
import 'fullcalendar';
import { OptionsInput } from 'fullcalendar';
import { FullCalendarTranslationService } from '../../../@core/utils/full-calendar-translation.service';
import { LangChangeEvent, TranslateService } from '@ngx-translate/core';
import { deepExtend } from '@nebular/auth/helpers';
const defaultOptions: OptionsInput = {
@dizco
dizco / fullcalendar.component.ts
Created August 2, 2018 07:19
Implementation of FullCalendar in TypeScript, inspired by https://github.com/akveo/ngx-admin/pull/1774
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
import * as $ from 'jquery';
import 'fullcalendar';
import { OptionsInput } from 'fullcalendar';
import { FullCalendarTranslationService } from '../../../@core/utils/full-calendar-translation.service';
import { LangChangeEvent, TranslateService } from '@ngx-translate/core';
import { deepExtend } from '@nebular/auth/helpers';
const defaultOptions: OptionsInput = {
@dizco
dizco / core.module.ts
Last active March 4, 2019 23:12
Custom auth token fields Nebular auth
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NbAuthModule, NbPasswordAuthStrategy } from '@nebular/auth';
import { throwIfAlreadyLoaded } from './module-import-guard';
import { DataModule } from './data/data.module';
import { environment as env } from '../../environments/environment';
import { HttpResponse } from '@angular/common/http';
import { getDeepFromObject } from '@nebular/auth/helpers';
import { AuthToken, AuthTokenFields } from './auth/token';
import { NbRoleProvider, NbSecurityModule } from '@nebular/security';