Skip to content

Instantly share code, notes, and snippets.

View marklawlor's full-sized avatar
💯

Mark Lawlor marklawlor

💯
View GitHub Profile
@marklawlor
marklawlor / afterorientationchange
Created October 2, 2014 01:31
orientationchange fires before the window resize event, which is not ideal when you need to resize content for the new viewport dimensions. This fix will allow you to handle orientation changes after the page has resized
window.addEventListener("orientationchange", function() {
var orientationChange = function(evt) {
//Put your code here
if (window.matchMedia("(orientation: landscape)").matches) {
alert("landscape");
}
else {
alert("portrait");
}
window.removeEventListener('resize', orientationChange);
@marklawlor
marklawlor / gist:01fed96ba9801bc3159a
Created October 7, 2014 23:31
iOS webkit overflow scrolling issue
/*
Source:http://stackoverflow.com/questions/18736297/webkit-overflow-scrolling-touch-broken-for-initially-offscreen-elements-in-i
*/
document.getElementById("scrollbox").addEventListener('touchstart', function(event){});
@marklawlor
marklawlor / setup.sh
Last active September 21, 2016 14:39
WIP Helper script to setup Mac OSX from a clean install
#!/bin/bash
#
# Helper functions
#
function pause(){
read -p "$*"
}
@marklawlor
marklawlor / Error regex
Last active November 1, 2015 22:55
JAWS JSON error responses
.*"status":400.*
var DOM = (selector, context) => (
dom => DOM2 = (selector, content) => (
DOM2.toString = () => dom,
dom += `<${selector}>${content}<\/${selector.split(' ')[0]}>`,
DOM2
))('')
(selector, context)
diff --git a/node_modules/babel-preset-expo/index.js b/node_modules/babel-preset-expo/index.js
index 1022490..08c8182 100644
--- a/node_modules/babel-preset-expo/index.js
+++ b/node_modules/babel-preset-expo/index.js
@@ -31,6 +31,8 @@ module.exports = function(api, options = {}) {
// Reference: https://github.com/expo/expo/pull/4685#discussion_r307143920
require('metro-react-native-babel-preset'),
{
+ dev: platform === 'web',
+ useTransformReactJsxExperimental: platform === 'web',
@marklawlor
marklawlor / main.js
Created April 28, 2021 00:07
Moti + Storybook + React-Native-Web
const path = require("path");
const { withUnimodules } = require("@expo/webpack-config/addons");
module.exports = {
stories: ["../src/**/*.stories.@(ts|tsx|js|jsx)"],
webpackFinal: async (config) => {
return withUnimodules(
config,
{
projectRoot: path.resolve(__dirname, "../"),
module.exports = {
presets: ["next/babel"],
plugins: [["react-native-web", { commonjs: true }]],
};
diff --git a/node_modules/@expo/next-adapter/build/withExpo.js b/node_modules/@expo/next-adapter/build/withExpo.js
index 2e63eb4..b1cf9a9 100644
--- a/node_modules/@expo/next-adapter/build/withExpo.js
+++ b/node_modules/@expo/next-adapter/build/withExpo.js
@@ -7,8 +7,8 @@ function withExpo(nextConfig = {}) {
// Prevent define plugin from overwriting Next.js environment.
process.env.EXPO_WEBPACK_DEFINE_ENVIRONMENT_AS_KEYS = 'true';
const expoConfig = addons_1.withUnimodules(config, {
- projectRoot: nextConfig.projectRoot || process.cwd(),
- }, { supportsFontLoading: false });
// This file was generated by tailwindcss-react-native. Do not edit!
const { StyleSheet } = require("react-native")
module.exports = {
styles: {
"flex-1": {
"flexGrow": 1,
"flexShrink": 1
},
"flex-row": {
"flexDirection": "row"