Skip to content

Instantly share code, notes, and snippets.

BIG iOS URL SCHEME LIST
HAD TO MAKE A DROPBOX FILE BECAUSE THIS LIST WAS TOO LONG TO POST IN THE COMMENTS OR NOT MAKE THE WORKFLOW APP TAKE FOREVER TO READ IT.
☠JAILBREAK/SYSTEM APPS
--------------------------
activator://
itms-apps://
itms-services://
@ChronSyn
ChronSyn / password_autofill_expo_how_to.md
Created September 18, 2018 16:50 — forked from amcvitty/password_autofill_expo_how_to.md
Configure Password Autofill on a React Native Expo app

Password Autofill on a React Native Expo app

Developing an app to accompany our website, worried that we would lose people in the transition if they couldn't remember their password, we were looking to make our app do Password AutoFill, a feature in iOS.

A talk from WWDC introducing the feature: https://developer.apple.com/videos/play/wwdc2017/206/

It works well, but there were a few bumps in the road making it work for React Native on Expo, so here are some notes to help out.

Apple's docs are here: https://developer.apple.com/documentation/security/password_autofill and they say something like this:

@ChronSyn
ChronSyn / withEventEmitter.js
Created January 15, 2019 08:38 — forked from tsapeta/withEventEmitter.js
Expo TaskManager example with EventEmitter
import React from 'react';
import { TaskManager } from 'expo';
import { EventEmitter } from 'fbemitter';
const taskName = 'task-name-of-your-choice';
const taskEventName = 'task-update';
const eventEmitter = new EventEmitter();
TaskManager.defineTask(taskName, ({ data, error }) => {
if (!error) {
@ChronSyn
ChronSyn / Fade.tsx
Created July 5, 2019 11:51 — forked from jesster2k10/Fade.tsx
React Native iOS 11 Style Large Title with Support For Search Component & Menu Buttons
import React, { Component } from 'react'
import { Animated, StyleProp, ViewStyle } from 'react-native'
export type FadeDirection = 'up' | 'down'
interface FadeProps {
visible?: boolean
style?: StyleProp<ViewStyle>
children: React.ReactNode
direction?: FadeDirection
@ChronSyn
ChronSyn / LimitStream.js
Created November 22, 2019 19:58 — forked from 4poc/LimitStream.js
Node.js: LimitStream (Bandwidth limited Readable+Writable Stream)
var fs = require('fs'),
util = require('util'),
Stream = require('stream').Stream;
/**
* Create a bandwidth limited stream
*
* This is a read+writeable stream that can limit how fast it
* is written onto by emitting pause and resume events to
* maintain a specified bandwidth limit, that limit can
@ChronSyn
ChronSyn / README.md
Created January 30, 2020 10:36 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@ChronSyn
ChronSyn / uk_train_classes.json
Last active February 9, 2020 17:45
UK Train Classes
{
"140": {
"Manufacturer": "",
"Date Built": 1980,
"Number Built": "1 × 2-car set",
"Withdrawn": 1981,
"Scrapped": ""
},
"141": {
"Type": "Pacer",
@ChronSyn
ChronSyn / demo.tsx
Created April 17, 2020 19:52
expo useNotification
import * as React from "react";
import { TouchableOpacity, Text } from "react-native";
import { Notifications } from "expo"
import { useNotification } from "./useNotification";
const sendNotification = async () => await Notifications.presentLocalNotificationAsync(
{
title: "Notified!",
body: "Hello, World!",
data: {}
@ChronSyn
ChronSyn / adaptTimeForToday.ts
Created April 18, 2020 02:30
Allows you to take a time from an existing Date object (or date-format string) and set todays' Date object to that time
const adaptTimeForToday = (time: Date | string): Date => {
const existingFormattedDate: Date = new Date(time);
const [hours, minutes, seconds]: number[] = existingFormattedDate.toLocaleTimeString().split(":").map((segment) => Number(segment));
const output: Date = new Date();
output.setHours(hours);
output.setMinutes(minutes);
output.setSeconds(seconds);
return output;
}
@ChronSyn
ChronSyn / useKeyboard.tsx
Created April 19, 2020 14:46
React + React Native useKeyboard hook
import { useEffect, useState } from "react";
import { Keyboard, KeyboardEvent } from "react-native";
export const useKeyboard = (): [number, boolean] => {
const [keyboardHeight, setKeyboardHeight] = useState(0);
const [keyboardVisible, setKeyboardVisible] = useState(false);
function onKeyboardDidShow(e: KeyboardEvent): void {
setKeyboardHeight(e.endCoordinates.height);
setKeyboardVisible(true);