Skip to content

Instantly share code, notes, and snippets.

View gregor-srdic's full-sized avatar

Gregor Srdic gregor-srdic

View GitHub Profile
@gregor-srdic
gregor-srdic / echo.js
Last active February 9, 2020 08:53
Echo operacija davčne blagajne
const request = require('request');
const fs = require('fs');
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;
const p12 = fs.readFileSync(__dirname + '/10537945-1.p12');
function echo() {
const data = { EchoRequest: 'furs' };
private loadComponentData() {
this.dataService
.getUserProfileObservable()
.pipe(takeUntil(this.unsubscribe$))
.subscribe((userProfile) =>
this.ngZone.run(() => {
this.userProfile = userProfile;
this.cdr.markForCheck();
})
);
{
...
"scripts": {
...
"start": "node dist/server",
"deploy": "ng build --prod && npm run build:ssr && gcloud app deploy"
},
"dependencies": {
...
}
# Copyright 2018, Google LLC.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<ion-header [scrollHide]="headerScrollConfig" [scrollContent]="pageContent">
...
</ion-header>
<ion-content #pageContent fullscreen>
...
</ion-content>
<ion-footer [scrollHide]="footerScrollConfig" [scrollContent]="pageContent">
...
import { Component} from '@angular/core';
import { ScrollHideConfig } from '../../directives/scroll-hide';
@Component({
selector: 'page-explore',
templateUrl: 'explore.html'
})
export class ExplorePage {
footerScrollConfig: ScrollHideConfig = { cssProperty: 'margin-bottom', maxValue: undefined };
@gregor-srdic
gregor-srdic / app.module.ts
Created February 15, 2018 21:36
Including scroll-hide directive in app.module.ts
@NgModule({
declarations: [
...
ScrollHideDirective
],
imports: [
...
IonicModule.forRoot(MyApp, {})
],
bootstrap: [IonicApp],
import { Content } from 'ionic-angular';
import { Directive, ElementRef, Input, Renderer2, SimpleChanges } from '@angular/core';
@Directive({
selector: '[scrollHide]'
})
export class ScrollHideDirective {
@Input('scrollHide') config: ScrollHideConfig;
@gregor-srdic
gregor-srdic / vendor.js
Last active October 17, 2017 06:27
vendor.js from ionic project that does not run on ios 9.3
This file has been truncated, but you can view the full file.
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ var parentJsonpFunction = window["webpackJsonp"];
/******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [], result;
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId]) {
@gregor-srdic
gregor-srdic / firebase_cloud_function_filter_points.js
Last active August 11, 2017 06:32
Firebase Cloud Function for filtering points closest to your location
const functions = require('firebase-functions');
const admin = require('firebase-admin');
/**
This is the cloud function that responds to http request
https://{your-app}.cloudfunctions.net/getNearbyPoints?lat=46.553955&lon=15.645714&max=10
*/
exports.getNearbyPoints = functions.https.onRequest((req, res) => {
const lat = req.query.lat;