Skip to content

Instantly share code, notes, and snippets.

@erikyuntantyo
erikyuntantyo / jwtRS256.sh
Created October 2, 2022 11:43 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@erikyuntantyo
erikyuntantyo / react-native-offline-bundling-android
Last active October 29, 2023 06:36
Build react-native offline bundling into android
# create assets folder in the current project
$ mkdir android/app/src/main/assets
# create bundle script
$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
# execute command to run android to create debug apk
$ react-native run-android
# Or change to android folder
@erikyuntantyo
erikyuntantyo / android-32bit-packages
Last active January 9, 2018 04:57
32bit packages needed to build android on linux 64bit (Arch)
$ sudo pacman -S lib32-glibc lib32-ncurses lib32-libstdc++5 lib32-zlib
@erikyuntantyo
erikyuntantyo / object_id_generator.php
Last active April 16, 2016 12:50
PHP Mongo ObjectId generator
<?php
function generate_object_id() {
$timestamp = str_pad(dechex(time()), 8, "0", STR_PAD_LEFT);
$machine = str_pad(dechex(rand(0, 16777215)), 6, "0", STR_PAD_LEFT);
$pid = str_pad(dechex(rand(0, 32767)), 4, "0", STR_PAD_LEFT);
$increment = rand(0, 16777215);
$increment++;
if ($increment > 0xffffff) {