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 / get-oauth2-token.sh
Last active July 10, 2017 16:02
WordPress.com oAuth2 access token request via command line (cURL)
#!/bin/sh
echo oAuth2 app id:
read appid
echo oAuth2 app secret:
read -s appsecret
echo Username:
read username
@hypest
hypest / pr_log.sh
Last active June 27, 2016 07:24
get my PR titles since most recent release branch tag in history
loginname=hypest; git fetch --all; latest_release=`git branch -r --sort=version:refname | grep 'origin/release' | tail -n1`; repo=`git remote -v | grep "^origin" | grep "fetch" | sed -n -e 's/.*github.com:\(.*\)\.git .*$/\1/gp'`;git log --merges --oneline $latest_release.. | grep "pull request" | sed -n -e 's/.* pull request #\([0-9]*\) .*$/\1/gp' | xargs -I PRNUM ok.sh _get https://api.github.com/repos/$repo/pulls/PRNUM | jq -r "if .user.login == \"$loginname\" then .title else empty end"
@hypest
hypest / aztec-act-like-local-lib.diff
Last active April 12, 2017 08:58
Make Aztec be a local lib to wpandroid. Aztec's source code is symlinked to `wpandroid/libs/WordPress-Aztec-Android`
diff --git a/aztec/build.gradle b/aztec/build.gradle
index 3f8fa81..9dbaba7 100644
--- a/aztec/build.gradle
+++ b/aztec/build.gradle
@@ -1,6 +1,24 @@
+buildscript {
+ ext.kotlin_version = '1.0.6'
+ repositories {
+ jcenter()
+ mavenCentral()
@hypest
hypest / example.kt
Created March 9, 2018 16:36
big text in EXAMPLE
private val EXAMPLE: String by lazy {
val sb = StringBuilder()
for (i in 0..10000) {
sb.append("word$i ")
}
sb.toString()
}
hypest-mbposx:~/proj/a8c/android/wp$ ./gradlew clean
Parallel execution with configuration on demand is an incubating feature.
> Configure project :WordPress
Configuration 'compile' in project ':WordPress' is deprecated. Use 'implementation' instead.
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
@hypest
hypest / gist:fa42651898b94ce47315c1a1cf84533c
Created March 31, 2018 22:44
demo text with many images to profile aztec
private val EXAMPLE =
IMG +
HEADING +
IMG +
IMG +
IMG +
IMG +
IMG +
IMG +
IMG +
@hypest
hypest / gist:cb0946b57669c5e1b6cee4d0a7c73b56
Created April 3, 2018 08:36
failing FluxC connected tests
> Task :example:connectedDebugAndroidTest
Starting 269 tests on Nexus 5X - 7.1.2
org.wordpress.android.fluxc.mocked.MockedStack_UploadStoreTest > testUploadMedia[Nexus 5X - 7.1.2] FAILED
java.lang.StringIndexOutOfBoundsException: length=5; index=-1
at java.lang.String.substring(String.java:1926)
org.wordpress.android.fluxc.mocked.MockedStack_UploadTest > testUploadMediaInCancelledPost[Nexus 5X - 7.1.2] FAILED
java.lang.StringIndexOutOfBoundsException: length=5; index=-1
at java.lang.String.substring(String.java:1926)
/** @format */
// For React Native version 0.52 or later
var upstreamTransformer = require( 'metro/src/transformer' );
// For React Native version 0.47-0.51
// var upstreamTransformer = require("metro-bundler/src/transformer");
// For React Native version 0.46
// var upstreamTransformer = require("metro-bundler/build/transformer");
@hypest
hypest / SpanLogger.kt
Created May 8, 2018 08:04
custom data view renderer to visualize the spans structure
package org.wordpress.aztec
import android.text.Spanned
import android.text.TextUtils
import java.util.*
/**
* Created by hypest on 11/01/17.
*/
object SpanLogger {
@hypest
hypest / gist:97c286579ec696da87747784053864cd
Last active May 11, 2018 11:53
spans for 2 simple GB blocks
This is a paragraph 1¶This is a paragraph 2 length = 43
<---------------------> 000 -> 022 : (1) GutenbergCommentSpan
<---------------------> 000 -> 022 : (2) ParagraphSpan
>--------------------< 022 -> 043 : (1) GutenbergCommentSpan
>--------------------< 022 -> 043 : (2) ParagraphSpan