Skip to content

Instantly share code, notes, and snippets.

View troZee's full-sized avatar

troZee

View GitHub Profile
@troZee
troZee / codegen.json
Created March 17, 2022 15:46
This is how callExpression looks like
{
"type": "TypeCastExpression",
"loc": {
"source": null,
"start": {
"line": 57,
"column": 41
},
"end": {
"line": 64,
@troZee
troZee / changelog.md
Last active June 29, 2022 09:51
How to generate changelog from git

Get diff on current branch

Command:

git --no-pager show -s --date=local --pretty=format:"- %h (%ae) %s%n"

Output:

- dcd509e ([email protected]) fix(ios): commit message 
@troZee
troZee / checkDepLastPublish.js
Created December 15, 2022 15:25
Check npm last publish date for each dependency inside a package.json file
const fs = require('fs');
const { exec } = require('child_process');
function execute(command, callback) {
exec(command, function (error, stdout, stderr) {
if (stderr || error) {
// console.log(`๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€๐Ÿš€ ${stderr} ${error}`);
} else {
callback(stdout);
}
@troZee
troZee / gist:a611537cb41e7ccec47b35ddb5faaaea
Created May 19, 2023 09:20
Calling a JS method from a native module using JSI in the React Native
// JS
BatchedBridge.registerCallableModule('JavaScriptVisibleToJava', {
alert: () => {
console.log('JavaScriptVisibleToJava');
},
});
//iOS
[self.bridge enqueueJSCall:@"JavaScriptVisibleToJava" method:@"alert" args:@[] completion:NULL];
@troZee
troZee / intl-e2e.sh
Created May 29, 2025 11:22
How to run e2e intl hermes tests
# SOURCE: https://github.com/facebook/hermes/blob/main/.github/workflows/build.yml#L544
# in the terminal, run the below command
emulator -avd AVD_NAME -timezone Europe/Paris -no-snapshot-save -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
#in the different terminal
rm -rf build build_android staging
export HERMES_WS_DIR=/Users/nick/xxxx/xxx
cd $HERMES_WS_DIR