Skip to content

Instantly share code, notes, and snippets.

Avatar
🙈

Christian Brevik cbrevik

🙈
View GitHub Profile
@cbrevik
cbrevik / realign-apk.sh
Created Oct 17, 2020
Re-align signed apk
View realign-apk.sh
~/Library/Android/sdk/build-tools/29.0.2/zipalign
-f 4
myapp-signed.apk
myapp-signed-realigned.apk
@cbrevik
cbrevik / rn-android-resigning.sh
Created Oct 17, 2020
RN Android code-resigning
View rn-android-resigning.sh
jarsigner
-keystore <keystore-name>.jks
-storepass '<storepass>'
-keypass '<keypass>'
-sigalg MD5withRSA
-digestalg SHA1
-signedjar myapp-signed.apk
myapp-modified.apk
<key alias>
@cbrevik
cbrevik / ios-code-resigning.sh
Last active Oct 17, 2020
RN iOS code re-signing
View ios-code-resigning.sh
rm -rf Payload/MyApp.app/\_CodeSignature
codesign -d
--entitlements :- "Payload/MyApp.app"
> entitlements.plist
codesign -f
-s "<My Certificate Name In Keychain>"
--entitlements entitlements.plist Payload/MyApp.app
@cbrevik
cbrevik / hermes_bytecode.sh
Created Oct 17, 2020
RN Hermes Bytecode Generation
View hermes_bytecode.sh
./node_modules/hermes-engine/osx-bin/hermesc
-emit-binary
-out android.bytecode.hbc
index.android.bundle
@cbrevik
cbrevik / android_bundle.sh
Created Oct 17, 2020
RN Android bundle command
View android_bundle.sh
npx react-native bundle
--platform android
--dev false
--reset-cache
--entry-file index.js
--bundle-output index.android.bundle
@cbrevik
cbrevik / ios_bundle.sh
Last active Oct 17, 2020
RN iOS bundle command
View ios_bundle.sh
npx react-native bundle
--platform ios
--dev false
--reset-cache
--entry-file index.js
--bundle-output main.jsbundle
View other_ssn_flavors.csx
int firstDigit = int.Parse(ssn.Substring(0, 1));
int thirdDigit = int.Parse(ssn.Substring(2, 1));
string type = (firstDigit, thirdDigit) switch
{
(8 or 9, _) => "FH",
( >= 4 and <= 7, _) => "D",
  (_, 4 or 5) => "H",
_ => null
};
View new_ssn.csx
int birthYear = (ruleNumber, year) switch
{
// Rule 1. 500–749: 1854–1899
(>= 500 and <= 749, >= 54) => 1800 + year,
// Rule 2. 000–499: 1900–1999
(< 500, _) => 1900 + year,
// Rule 3. 900–999: 1940–1999
(>= 900, >= 40) => 1900 + year,
// Rule 4. 500–999: 2000–2039
(>= 500, <= 39) => 2000 + year,
View olden_ssn.csx
int day = int.Parse(ssn.Substring(0, 2));
int month = int.Parse(ssn.Substring(2, 2));
int year = int.Parse(ssn.Substring(4, 2));
int ruleNumber = int.Parse(ssn.Substring(6, 3));
int birthYear = 0;
// Rule 1. 500–749: 1854–1899
if (year >= 54 && ruleNumber >= 500 && ruleNumber <= 749)
{
birthYear = 1800 + year;
@cbrevik
cbrevik / config.fish
Created Apr 8, 2019
Fishshell config
View config.fish
# just the most essential stuff
abbr ga 'git add'
abbr gs 'git status'
abbr gb 'git branch'
abbr gcom 'git commit'
abbr gd 'git difftool --no-prompt'
abbr gdd 'git difftool --dir-dif'
abbr gco 'git checkout'
abbr gpr 'git pull --rebase'
You can’t perform that action at this time.