Skip to content

Instantly share code, notes, and snippets.

View hypest's full-sized avatar
😎
Working from anywhere

Stefanos Togoulidis hypest

😎
Working from anywhere
View GitHub Profile
@hypest
hypest / patch.diff
Created February 16, 2021 13:18
Fallback to text JS for gutenberg-mobile
diff --git a/packages/react-native-editor/package.json b/packages/react-native-editor/package.json
index bcb2ee95f9..69adc453fa 100644
--- a/packages/react-native-editor/package.json
+++ b/packages/react-native-editor/package.json
@@ -87,7 +87,7 @@
"postrn-bundle": "cd ../.. && patch-package --reverse --patch-dir packages/react-native-editor/metro-patch",
"prebundle": "npm run i18n-cache:force",
"bundle": "npm run bundle:android && npm run bundle:ios",
- "bundle:android": "mkdir -p bundle/android && npm run rn-bundle -- --platform android --dev false --entry-file index.js --assets-dest bundle/android --bundle-output bundle/android/App.text.js --sourcemap-output bundle/android/App.text.js.map && ./gutenberg/node_modules/hermes-engine/`node -e \"const platform=require('os').platform();console.log(platform === 'darwin' ? 'osx-bin' : (platform === 'linux' ? 'linux64-bin' : (platform === 'win32' ? 'win64-bin' : 'unsupported-os')));\"`/hermes -emit-binar
@hypest
hypest / .bash_profile
Created February 7, 2021 23:00
Defer nvm init to speed up bash init. Just backin up the solution found in https://www.growingwiththeweb.com/2018/01/slow-nvm-init.html
# Defer initialization of nvm until nvm, node or a node-dependent command is
# run. Ensure this block is only run once if .bashrc gets sourced multiple times
# by checking whether __init_nvm is a function.
if [ -s "$HOME/.nvm/nvm.sh" ] && [ ! "$(type -t __init_nvm)" = function ]; then
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
declare -a __node_commands=('nvm' 'node' 'npm' 'yarn' 'gulp' 'grunt' 'webpack')
function __init_nvm() {
for i in "${__node_commands[@]}"; do unalias $i; done
. "$NVM_DIR"/nvm.sh
@hypest
hypest / gist:ca9979991028a923e76a36a88281cd73
Last active March 15, 2022 09:38
Appium desktop config
{
"appium:app": "/Users/hypest/proj/a8c/rn/t3/gutenberg-mobile/gutenberg/packages/react-native-editor/android/app/build/outputs/apk/debug/app-debug.apk",
"appium:deviceName": "emulator-5554",
"platformName": "android",
"appium:platformVersion": "12"
}
@hypest
hypest / diff.diff
Last active September 16, 2020 08:52
Diff to make MeetamatticianListActivity pick up theme setting change
diff --git a/app/src/main/java/automattic/com/meetamattician/MeetamatticianListActivity.java b/app/src/main/java/automat
index 739192d..8c88629 100644
--- a/app/src/main/java/automattic/com/meetamattician/MeetamatticianListActivity.java
+++ b/app/src/main/java/automattic/com/meetamattician/MeetamatticianListActivity.java
@@ -20,6 +20,7 @@ import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
+import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.LinearLayoutManager;
@hypest
hypest / clone-from-mirror.sh
Last active March 10, 2022 12:31
Update git mirrors
#!/bin/bash
# Assume the clone-from-mirror.sh script is alongside the mirrors folders
# get the folder of the script itself (from https://stackoverflow.com/a/246128)
SOURCE=${BASH_SOURCE[0]}
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
diff --git a/WordPress/src/main/res/values/styles.xml b/WordPress/src/main/res/values/styles.xml
index 9b088771a5..f9a82d8222 100644
--- a/WordPress/src/main/res/values/styles.xml
+++ b/WordPress/src/main/res/values/styles.xml
@@ -600,6 +600,12 @@
</style>
<!--Post Settings Styles-->
+ <style name="PostSettingsCardView">
+ <item name="android:layout_width">match_parent</item>
diff --git a/android/app/build.gradle b/android/app/build.gradle
index c986be65..4a6aaa2b 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -74,7 +74,7 @@ import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js",
- enableHermes: true, // clean and rebuild if changing
+ enableHermes: false, // clean and rebuild if changing
@hypest
hypest / instructions.md
Created December 18, 2019 22:33
Upgrading gradle and wrapper in android project
@hypest
hypest / gist:5cf03d4711bd5f8c36b365de991c7510
Last active December 8, 2019 00:17
Github tooling around managing PRs/branches with chains, trains, etc
https://github.com/realyze/pr-train
https://github.com/ryanhiebert/probot-chain
https://github.com/z0al/dep
https://github.com/probot/probot/issues/511
https://github.com/chdsbd/kodiak
https://github.com/xavijam/probot-empty
https://github.com/palantir/bulldozer
https://github.com/marketplace/actions/initialize-pull-request
https://github.com/marketplace/actions/github-pull-request-action
@hypest
hypest / aztec_from_source.patch
Created November 8, 2019 11:55
Using Aztec from source in Gutenberg-mobile
diff --git a/android/build.gradle b/android/build.gradle
index 00832c50..e298f241 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -8,6 +8,13 @@ buildscript {
targetSdkVersion = 28
supportLibVersion = '28.0.0'
wordpressUtilsVersion = '1.22'
+ kotlinCoroutinesVersion = '1.1.0'
+ tagSoupVersion = '1.2.1'