Skip to content

Instantly share code, notes, and snippets.


Mike Diarmid Salakar

View GitHub Profile
kentcdodds / useOnRead.tsx
Last active Jun 9, 2021
How I determine whether you've read a blog post.
View useOnRead.tsx
function useOnRead({
enabled = true,
}: {
parentElRef: React.RefObject<HTMLElement>
onRead: () => void
enabled: boolean
}) {
React.useEffect(() => {
Salakar /
Last active Jul 17, 2020
Changes preview of the current FlutterFirebase Firestore plugin rework.


⚠️ NOTE: These changes may not reflect the final plugin changes/API as it's still going through review.

Along with the below changes, the plugin has undergone a quality of life update to better support exceptions thrown. Any Firestore specific errors now return a FirebaseException, allowing you to directly access the code (e.g. permission-denied) and message.


  • BREAKING: settings() is now a synchronous setter that accepts a Settings instance.
    • NEW: This change allows us to support changing Firestore settings (such as using the Firestore emulator) without having to quit the application, e.g. Hot Restarts.
  • DEPRECATED: Calling document() is deprecated in favor of doc().
kelset /
Last active Mar 9, 2021
This is kind of a blogpost about my experience of diving deep to improve some timings for an iOS React Native app

Improving times for both iOS build and CI for a React Native app


Hello there.

So, if you are here you probably saw my previous tweet where I asked for tips & tricks on improving the timing on an iOS/React Native app build time.

What will follow was how I mixed those suggestions + some good old GoogleSearch-fu + me deep diving on this for ~2 days.

edvinasbartkus / android.yml
Created Nov 20, 2019
Running Detox tests for Android on Github Actions Workflow
View android.yml
name: Android
on: [push]
runs-on: macos-latest
- name: Checkout
edvinasbartkus / .github-workflows-main.yml
Created Nov 16, 2019
Github Action for React Native Detox
View .github-workflows-main.yml
name: Detox
on: [push]
runs-on: macOS-latest
timeout-minutes: 15
JoeMatt / Set Plist Bundle to Git
Last active Sep 13, 2021
Xcode 10 set Info.plist build version
View Set Plist Bundle to Git

Create Info.plist


This script will update Info.plist of a target in XCode with the following

  1. CFBundleVersion to the git commit count
  2. GitDate to the date of the last commit
  3. GitBranch to the current branch name
  4. GitTag to the latest tag on current branch

Creates a .version file to track last update and appease XCode needing a non-mutable output path.

DoguD / config.yml
Last active Feb 11, 2021 — forked from alexttransisland/gist:e8ebb98f769d31d7d0a0111550eb4bd8
Run Android emulator on CircleCI 2.0 macOS
View config.yml
version: 2
## Constants
gradle_cache_path: &gradle_cache_path
gradle_cache-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
workspace: &workspace
## Configurations
android_config: &android_config
working_directory: *workspace
a-barbieri /
Last active Jun 6, 2021
NextJS sitemap generator with dynamic URL

NextJS sitemap generator


The current setup has been tested on Next Js 7.0.0.

You need to install Axios.

$ npm install axios
osopolar / com.user.time-machine-exclude-node-modules-job.plist
Last active Aug 19, 2021 — forked from peterdemartini/
Exclude node_modules (and more) from timemachine, use launchd to scan the Project directory on a regular basis, for example meanwhile you are having siesta. Put this file in ~/Library/LaunchAgents and call `launchctl load ~/Library/LaunchAgents/com.user.time-machine-exclude-node-modules-job.plist`
View com.user.time-machine-exclude-node-modules-job.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
bmeck / bus.js
Created Jun 23, 2018
it is a better API at least
View bus.js
// Example way to construct a Bus
// const ctrl = new SharedArrayBuffer(12);
// const size = new SharedArrayBuffer(4);
// let busSize = 4096;
// const data = new SharedArrayBuffer(busSize);
// const bufs = {ctrl,size,data,};
// const bus = new Bus(bufs);
'use strict';