Skip to content

Instantly share code, notes, and snippets.

View jd-alexander's full-sized avatar
🏠
Working from home

Joel Dean jd-alexander

🏠
Working from home
View GitHub Profile
{
"openapi": "3.0.0",
"info": {
"title": "API Documentation",
"description": "",
"version": "1.0"
},
"paths": {
"/api/v1/attachments": {
"post": {
@jd-alexander
jd-alexander / caldera-upload-form-testing.json
Created November 16, 2021 09:04
caldera-upload-form-testing.json
{"ID":"CF61934c38ade61","_last_updated":"Tue, 16 Nov 2021 06:33:18 +0000","cf_version":"1.9.5","name":"Upload Form","scroll_top":0,"success":"Form has been successfully submitted. Thank you.\t\t\t\t\t\t\t\t\t","db_support":1,"pinned":0,"hide_form":1,"check_honey":1,"avatar_field":null,"form_ajax":1,"custom_callback":"","layout_grid":{"fields":{"fld_1998940":"2:1","fld_2908240":"2:1","fld_9876395":"2:1","fld_3060514":"3:1","fld_9230851":"3:1","fld_991569":"3:1"},"structure":"12|12|12|12"},"fields":{"fld_1998940":{"ID":"fld_1998940","type":"file","label":"Allow Single Images","slug":"allow_single_images","conditions":{"type":""},"caption":"","config":{"custom_class":"","multi_upload_text":"","allowed":"jpg, png, gif","max_upload":"","email_identifier":0,"personally_identifying":0}},"fld_3060514":{"ID":"fld_3060514","type":"cf2_file","label":"Allow Multiple Images","slug":"allow_multiple_images","conditions":{"type":""},"caption":"","config":{"custom_class":"","multi_upload_text":"","multi_upload":1,"allowed":"j
@jd-alexander
jd-alexander / editor_test_case.md
Created June 16, 2020 18:26
Prepublishing Nudges

Prepublishing Nudges - Editor Test Cases

Tags

  1. Create a new post.
  2. Press publish.
  3. Select the Tags field.
  4. See the tags screen.
  5. Add tags and press back so they can be saved.
  6. You can also collapse the whole bottom sheet using the close button.
--------- beginning of crash
2020-01-21 21:01:48.788 22119-22337/org.wordpress.android.beta E/AndroidRuntime: FATAL EXCEPTION: create_react_context
Process: org.wordpress.android.beta, PID: 22119
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:31)
at com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:19)
/**
I wrote this code recently for a Word Puzzle game I created and this particular class is responsible for processing the touch
events that occur when the user swipes on different words within the grid. It's suppose to detect the direction that the swipe
took place in so that it can utilize the direction to determine the coordinates between the start and end event of the touch
interaction so that it can highlight those letters. I found this code interesting because I had to use coordinate geometry
knowledge I learnt in college to solve the issues at hand and I learnt alot about how coordinates are represented on screens.
**/
class CoordinatesDirectionInteractor @Inject constructor() {
private var swipeDirection: SwipeDirection? = null
private var swipeType: SwipeType? = null
package com.automattic.freshlypressed.util
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.text.Html
import android.widget.TextView
final StorageReference storageReference = mStorageRef.getRoot();
storageReference.child("uploads").child(fileNAME).putFile(pdfUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Task<Uri> url = taskSnapshot.getMetadata().getReference().getDownloadUrl();
url.addOnCompleteListener(new OnCompleteListener<Uri>() {
@Override
public void onComplete(@NonNull Task<Uri> task) {
val TAG = "hash"
try {
val info = context.packageManager.getPackageInfo("", PackageManager.GET_SIGNATURES)
for (signature in info.signatures) {
val md = MessageDigest.getInstance("SHA")
md.update(signature.toByteArray())
val hashKey = String(Base64.encode(md.digest(), 0))
Log.i(TAG, "printHashKey() Hash Key: $hashKey")
}
} catch (e: NoSuchAlgorithmException) {
@jd-alexander
jd-alexander / AndroidJavaCodeReview.md
Created April 9, 2018 04:09 — forked from srivastavarobin/AndroidJavaCodeReview.md
Code Review Checklist for Android (Java Only)

My Android Java Code Review Checklist

  1. Is the functionality correct?
  2. Are the classes named suitably?
  3. Are the functions named suitably?
  4. How's the datastructure being used? Is it the correct DS or it needs improvement?
  5. Can the classes be further borken into small classes?
  6. Do we need an interface?
  7. If it contain functions that can be reused later then are there Utils created for them?
  8. Can it use already available Util functions?
  9. Does the large set of input for a function deserve a new bean to be created?
android.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with text: is "zq8FP1jk"
View Hierarchy:
+>DecorView{id=-1, visibility=VISIBLE, width=1080, height=1920, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=WM.LayoutParams{(0,0)(fillxfill) sim=#10 ty=1 fl=#81810100 wanim=0x1030466 surfaceInsets=Rect(0, 0 - 0, 0) needsMenuKey=2}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=3}
|
+->LinearLayout{id=-1, visibility=VISIBLE, width=1080, height=1776, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.FrameLayout$LayoutParams@69c7b5f, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-coun