Skip to content

Instantly share code, notes, and snippets.

@FLGMwt
FLGMwt / get-npm-install-comment-for-rn-packages.js
Last active March 25, 2026 22:19
RN upgrade helper to npm i command
// helper script for generating an `npm install` command for packages chagnes when @rnx-kit/align-deps is bad
// given example for:
// https://react-native-community.github.io/upgrade-helper/?from=0.82.1&to=0.83.4
const packages = {
// copy & paste from https://react-native-community.github.io/upgrade-helper's package.json green lines
// following example from https://react-native-community.github.io/upgrade-helper/?from=0.82.1&to=0.83.4
// HEY YOU!
@FLGMwt
FLGMwt / perfVibeExperiment.ts
Last active March 24, 2026 22:14
js promise perf vibe check
// usage:
// await experiment( "getFreeDiskStorage", DeviceInfo.getFreeDiskStorage )
const times = 1000;
const experiment = async ( label:string, func: () => Promise<unknown> ) => {
let firstTime = 0;
let firstTenTimesSum = 0;
let sum = 0;
// eslint-disable-next-line no-plusplus
for ( let index = 0; index < times; index++ ) {
@FLGMwt
FLGMwt / addMetadata.sh
Created May 9, 2021 21:34
Add title / artists / chapter metadata to an `.mp4` using `FFmpeg`
ffmpeg -i video.mp4 -i metadata.txt -map_metadata 1 -codec copy video_with_metadata.mp4
@FLGMwt
FLGMwt / cowsay.js
Last active December 16, 2020 15:37
#!/usr/bin/env node
console.log(`Cow says: ${process.argv[2] || 'moo'}`)
// tired
if (node.Expression is IdentifierNameSyntax)
{
// node.Expression.Identifier.Dump(); <- `Does not contain a definition for "Identifier"`
var id = (IdentifierNameSyntax)node.Expression;
id.Identifier.Dump();
}
// wired
if (node.Expression is IdentifierNameSyntax id)
// By RoslynQuoter - source code at: https://github.com/KirillOsenkov/RoslynQuoter
SyntaxFactory.CompilationUnit()
.WithMembers(
SyntaxFactory.SingletonList<MemberDeclarationSyntax>(
SyntaxFactory.GlobalStatement(
SyntaxFactory.ExpressionStatement(
SyntaxFactory.InvocationExpression(
SyntaxFactory.MemberAccessExpression(
SyntaxKind.SimpleMemberAccessExpression,
@FLGMwt
FLGMwt / .circleci.config.yml
Created August 2, 2019 15:32
Cavy e2e + expo + CirlceCI + genymotion cloud
version: 2.1
executors:
expo_turtle_android_executor:
docker:
- image: my/private/registry/expo-turtle-android:turrrrrtle
working_directory: /home/circleci/expo-project
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
android_executor:
void Main()
{
var words = new List<string>();
Exclaimer exclaimer = null;
var exclaimedWords = words.Select(a => exclaimer.Exclaimify(a)).ToList();
var moarExclaimedWords = words.Select(exclaimer.Exclaimify).ToList();
}