Skip to content

Instantly share code, notes, and snippets.

View rodneyrehm's full-sized avatar

Rodney Rehm rodneyrehm

View GitHub Profile
@rodneyrehm
rodneyrehm / README.md
Created February 23, 2021 13:43
OpenShift Secrets

Phoenix Cloud Shared Secrets

Creating Secrets

See OpenShift: Providing sensitive data to pods

oc -n "${NAMESPACE}" delete secret "${SECRET_NAME}"
oc -n "${NAMESPACE}" create secret generic "${SECRET_NAME}" --from-env-file="secrets/${SECRET_NAME}.env"
@rodneyrehm
rodneyrehm / README.md
Created December 23, 2020 16:21
Patching expo for expo-constants, expo-linking and expo-font to work in Bare Workflow

Patching Expo to work in all workflows (Bare and Managed)

{
  "expo": {
    "entryPoint": "index.js"
  }
}
@rodneyrehm
rodneyrehm / AppDelegate.h
Created November 19, 2020 19:12
AppDelegate - expo-screen-orientation
#import <Foundation/Foundation.h>
#import <EXUpdates/EXUpdatesAppController.h>
#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>
#import <UMCore/UMAppDelegateWrapper.h>
@interface AppDelegate : UMAppDelegateWrapper <RCTBridgeDelegate, EXUpdatesAppControllerDelegate>
@end
@rodneyrehm
rodneyrehm / README.md
Last active January 6, 2020 12:36
ExpoKit: building non-OTA standalones

ExpoKit: building non-OTA standalones

This gist is based on Hosting An App on Your Servers in order to create standalone applications that contain all bundles and assets (that have not been expo published) and do not download over-the-air updates (OTA).

We needed APKs and IPAs for integration/end-to-end testing that would not pull the latest OTA updates, but rather run the code they were built with. We didn't want to expo publish countless intermediate versions. We needed the ability to build different versions concurrently without one build interfering with the other.

Usage

change the values of manifestBaseUrl and releaseChannel in post-expo-export.ts to suit your needs

@rodneyrehm
rodneyrehm / gradlew-output.txt
Created December 3, 2019 23:32
ExpoKit @sentry/react-native not uploading Debug Information Files
➜ ./gradlew bundleRelease --console plain +? ✗ [git:build/daedalus]
Parallel execution with configuration on demand is an incubating feature.
> Configure project :@sentry_react-native
WARNING: The specified Android SDK Build Tools version (28.0.0) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.3.2.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
> Configure project :app
AWS Device Farm Plugin version 1.3
@rodneyrehm
rodneyrehm / sentry-clean-debug-information-files.js
Created July 17, 2019 15:19
Sentry Cleanup: Debug Information Files
const axios = require('axios')
const LinkHeader = require('http-link-header')
const nextPage = (header) => {
const link = LinkHeader.parse(header)
const [ next ] = link.get('rel', 'next')
return next && next.results === 'true' ? next.uri : null
}
@rodneyrehm
rodneyrehm / README.md
Last active January 30, 2019 21:28
execute batches of HTTP requests in parallel

Parallel HTTP request execution

  • Takes values from a text file and converts them into HTTP requests (against an echo service with a request execution time of 150ms - 200ms).
  • splits the text file into chunks of $CHUNKS number of items which get executed in sequence by a single curl invocation that reuses the connection (reducing TCP and TLS overhead)
  • $PARALLEL number of chunks are executed concurrently by sem (of GNU parallel)

Example

The demo generates 100 requests. Each request's response is stored to disk (because why not).

@rodneyrehm
rodneyrehm / browser.js
Last active August 14, 2018 11:17
Looking to find low powered devices to disable animations and stuff
// https://github.com/bestiejs/platform.js
import platform from 'platform'
export const OS = (platform.os.family || '').toLowerCase()
export const ANDROID = OS === 'android'
export const IOS = OS === 'ios'
export const VERSION = parseFloat(platform.version)
export const MAJOR_VERSION = Math.floor(VERSION)

How best to encapsulate data retrieval and conversion stuff as shown in the gustav.mixin.js demo, so that it can be easily used in multiple components like gustav.vue?

The problem here is that from the component's perspective we're only interested in providing ottoId and receiving gustav. All other properties from data, computed, methods are at best irrelevant to the component - at worst may cause conflicts.

Is there any sane way I can stay in the "how a mixin would do it" kind of code, but achieve only the export of computed.gustav, watch.ottoId and created?

@rodneyrehm
rodneyrehm / polyfill-intl.js
Created August 21, 2017 08:16
Webpack: load Intl polyfill with languages
const needsPolyfill = !window.Intl
/* eslint-disable import/no-webpack-loader-syntax */
const intl = require('bundle-loader?lazy&name=intl!intl')
/* eslint-enable import/no-webpack-loader-syntax */
const polyfilled = needsPolyfill && new Promise(resolve => {
intl(resolve)
})