Skip to content

Instantly share code, notes, and snippets.

View roryabraham's full-sized avatar

Rory Abraham roryabraham

  • Expensify, Inc.
View GitHub Profile
@roryabraham
roryabraham / ios.yml
Created February 21, 2024 23:31
Problematic Cocoapods caching strategy for Expo
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm
cache-dependency-path: |
package-lock.json
desktop/package-lock.json
- id: cache-node-modules
uses: actions/cache@v3
@roryabraham
roryabraham / android-screen-record.sh
Created February 3, 2024 00:39
A useful script to capture android screen from mac or linux terminal
#!/bin/bash
destination=$1
deviceName="$(adb shell getprop ro.product.model)"
function postRecord() {
echo "⏳ Pulling screen recording from device..."
sleep 3
adb pull /sdcard/tmp.mp4 "$destination" 1>/dev/null
adb shell rm /sdcard/tmp.mp4 1> /dev/null
@roryabraham
roryabraham / index.css
Created May 12, 2023 00:42
contenteditable POC
body {
font-family: sans-serif;
}
#editor {
background-color: #f0f0f0;
min-height: 20rem;
padding: 1rem;
}
@roryabraham
roryabraham / webpack.common.js
Created May 18, 2022 20:15
How to inject dynamic port into webpack bundle environment
const path = require('path');
const portfinder = require('portfinder');
const {DefinePlugin} = require('webpack');
const {merge} = require('webpack-merge');
const getCommonConfig = require('./webpack.common');
const BASE_PORT = 8080;
/**
* Configuration for the local dev server
@roryabraham
roryabraham / Chaos.js
Created April 6, 2022 03:24
JavaScript utility for generating random stuff and doing stuff randomly
import {promiseWhile} from './promiseWhile';
/**
* Flip a coin!
*
* @returns {Boolean}
*/
function randomBool() {
return Math.random() < 0.5;
}
import {getPullRequestsMergedBetween} from 'expensify-common';
// Then hard-code your test usages here and console.log the results
@roryabraham
roryabraham / HoverablePropTypes.js
Created February 12, 2021 21:37
Hoverable that works with modals
import PropTypes from 'prop-types';
const propTypes = {
// Children to wrap with Hoverable.
children: PropTypes.oneOfType([
PropTypes.node.isRequired,
PropTypes.func.isRequired,
]).isRequired,
// Function that executes when the mouse moves over the children.