Skip to content

Instantly share code, notes, and snippets.

View dtarnawsky's full-sized avatar

Damian Tarnawsky dtarnawsky

View GitHub Profile
@dtarnawsky
dtarnawsky / .eslintrc.json
Created March 17, 2023 23:03
Default eslintrc.json file for Ionic Angular Projects
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json"],
"createDefaultProgram": true
},
@dtarnawsky
dtarnawsky / home.page.ts
Created February 27, 2023 19:10
intune home page
import { Component, OnInit, SimpleChanges } from '@angular/core';
import { Router } from '@angular/router';
import {
IntuneMAM, IntuneMAMAcquireTokenSilentOptions, IntuneMAMAppConfig, IntuneMAMGroupName,
IntuneMAMPolicy, IntuneMAMUser, IntuneMAMVersionInfo
} from '@ionic-enterprise/intune';
import { BehaviorSubject } from 'rxjs';
@Component({
@dtarnawsky
dtarnawsky / web-encrypting.md
Last active November 23, 2022 14:53
Method to encrypt data on the web (backend knows private key and can decrypt)
@dtarnawsky
dtarnawsky / autofill.directive.ts
Last active March 29, 2023 02:13
Directive to help autofill an ion-input for iOS
import { Directive, ElementRef, OnInit } from '@angular/core';
import { Capacitor } from '@capacitor/core';
@Directive({
selector: '[appAutofill]'
})
export class AutofillDirective implements OnInit {
constructor(private el: ElementRef) {
}
@dtarnawsky
dtarnawsky / token-provider.ts
Last active May 9, 2022 22:44
Custom Token Storage Provider for IV
import { Injectable } from '@angular/core';
import { TokenStorageProvider } from '@ionic-enterprise/auth';
import { VaultService } from './vault.service';
@Injectable({
providedIn: 'root'
})
export class TokenProviderService implements TokenStorageProvider {
constructor(private vaultService: VaultService) {
}
@dtarnawsky
dtarnawsky / update-launcher.js
Created October 5, 2021 22:19
Update the Android Launcher Activity for AC
let ANDROID_PROJECT_ROOT = "platforms/android/app/src/main";
const fs = require("fs");
const path = require("path");
const xml2js = require("xml2js");
function writeJavaLauncher() {}
function readManifest() {
return new Promise((resolve, reject) => {
fs.readFile(
@dtarnawsky
dtarnawsky / analytics.service.ts
Last active September 28, 2021 18:44
Google Analytics Service
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { NavigationEnd } from '@angular/router';
import { isDefined } from 'lib/util';
let singletonInstance: AnalyticsService;
export const analyticsServiceSingleton: Function = (): AnalyticsService => singletonInstance;
export interface EventParams {
action: string;
@dtarnawsky
dtarnawsky / index.html
Created August 25, 2021 18:04
ion-grid in an html file
<html>
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core/css/ionic.bundle.css" />
<body>
<ion-grid>
<ion-row>
<ion-col>
<div>1 of 2</div>
@dtarnawsky
dtarnawsky / capacitor-webapp.md
Last active June 24, 2021 17:13
How to take your web app to the App Store

Take your web app to the App Store

Do you have a web application that you want to put in the App Store or Play Store?

If so then this guide (with the help of Capacitor) will help you create a XCode and Android Studio project containing your web application that you can build, run and deploy to the store.

What web applications can be converted?

If your web application ends up as html, css and js then you are in luck. Here are some types of web applications you can create a native app using this guide:

  • Modern SPA Frameworks (React, Angular, Vue)
  • Older Frameworks (Jquery, Jquery Mobile, Bootstrap)
@dtarnawsky
dtarnawsky / .eslintrc.json
Created June 11, 2021 16:10
ESLintRC file for Strict Angular Rules
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],