Skip to content

Instantly share code, notes, and snippets.

View mlynch's full-sized avatar
🍂
Building something new

Max Lynch mlynch

🍂
Building something new
View GitHub Profile
@mlynch
mlynch / Heading.tsx
Last active May 11, 2020 01:10
Scroll Spy Provider
const Heading = (props: Props) => {
const ref = useRef<HTMLHeadingElement>();
const ScrollSpy = useContext(ScrollSpyContext);
if (
ref.current &&
["H1", "H2", "H3"].indexOf(ref.current.tagName) >= 0
) {
value?.observer!.observe(ref.current);
}
/**
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
*/
<template>
<div class="ion-page">
<ion-header>
@mlynch
mlynch / menu.html
Last active November 2, 2017 20:32
<ion-split-pane>
<ion-menu [content]="nav" side="start"...>
</ion-menu>
<ion-nav [root]="rootPage" #nav main></ion-nav>
</ion-split-pane>
@mlynch
mlynch / generate.js
Last active February 7, 2019 18:11
Stencil component generator
/*
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
mlynch / cordova-plugin-guide.md
Last active February 3, 2023 00:21
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.

Introduction

.get('/apple-app-site-association', function(req, res) {
res.header('Content-Type', 'application/pkcs7-mime');
res.render('apple-app-site-association.txt');
})
@mlynch
mlynch / cordova.ts
Created November 24, 2015 04:57 — forked from robwormald/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
mlynch / gist:20eedbf80f2ddbd8df45
Last active October 19, 2015 15:09
Ionic Workshop Links
@mlynch
mlynch / info.plist
Last active August 6, 2023 07:31
Disable App Transport Security in iOS 9
<!--
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:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
@mlynch
mlynch / ionRadio.js
Last active October 13, 2022 15:07
ionRadio fix for iOS 9 bugs
/**
* 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() {