Skip to content

Instantly share code, notes, and snippets.


Max Lynch mlynch

View GitHub Profile
mlynch / Heading.tsx
Last active May 11, 2020
Scroll Spy Provider
View Heading.tsx
const Heading = (props: Props) => {
const ref = useRef<HTMLHeadingElement>();
const ScrollSpy = useContext(ScrollSpyContext);
if (
ref.current &&
["H1", "H2", "H3"].indexOf(ref.current.tagName) >= 0
) {
View ionic-vue-inputs.vue
Ionic Vue 0.0.8-next prerelease adds support for v-model to all Ionic inputs.
To try it out, run
npm install @ionic/vue@next
<div class="ion-page">
View menu.html
<ion-menu [content]="nav" side="start"...>
<ion-nav [root]="rootPage" #nav main></ion-nav>
mlynch / generate.js
Last active Feb 7, 2019
Stencil component generator
View generate.js
To setup, place in scripts/generate.js and add
"st:generate": "node scripts/generate.js"
To your npm scripts.
To generate a component in src/components/ run
npm run st:generate component my-component
mlynch /
Last active Dec 31, 2021
Cordova Plugin Developer Guide

Cordova Plugin Development Guide (iOS and Android)

Version: 0.0.1 updated 7/1/2016

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

Building Cordova plugins is scary for many Cordova and Ionic developers, but it doesn't have to be. This simple guide walks through the what, when, why, and how of Cordova plugin development for iOS and Android.


View routes.js
.get('/apple-app-site-association', function(req, res) {
res.header('Content-Type', 'application/pkcs7-mime');
View cordova.ts
const promisifyCordova = (pluginName:string, methodName:string) => {
return (...args) => {
return new Promise((resolve, reject) => {
cordova.exec(resolve, reject, pluginName, methodName, args);
const observablifyCordova = (pluginName:string, methodName:string, cleanUpMethodName?:string) => {
return (..args) => {
mlynch / info.plist
Last active Jul 31, 2022
Disable App Transport Security in iOS 9
View info.plist
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
And add this XML right before the end of the file inside of the last </dict> entry:
mlynch / ionRadio.js
Last active Jan 5, 2021
ionRadio fix for iOS 9 bugs
View ionRadio.js
* ionRadioFix - fixes a bug in iOS 9 UIWebView that breaks the tilde selector in CSS. To
* use this fix, include it after your Ionic bundle JS.
* Note: due to Angular directive override limitations, you'll need to change any reference
* to <ion-radio> to <ion-radio-fix> to apply this patched radio button.
* Also, make sure to add the new CSS from the second part of this gist.
angular.module('ionic').directive('ionRadioFix', function() {