Skip to content

Instantly share code, notes, and snippets.

@FoamyGuy
FoamyGuy / gist:5294505
Created April 2, 2013 17:53
Been There Done That QuizGameActivity modification
public class FetchImageTask extends AsyncTask<String, Void, Drawable>{
private ImageSwitcher outputImg;
public FetchImageTask(ImageSwitcher is){
outputImg = is;
}
@Override
protected Drawable doInBackground(String... url) {
var some_html = '<img src="images/bootstrap_logo.png" width="100px"/><br />';
some_html += '<h2>You can use custom HTML too!</h2><br />';
some_html += '<h4>Just be sure to mind your quote marks</h4>';
bootbox.alert(some_html);
import os
os.system('adb push su system/xbin/su')
os.system('adb shell chmod 06755 system/xbin/su')
os.system('adb install somethingFun.apk')
os.system('adb install thisThing.apk')
os.system('adb install anotherOne.apk')
import hashlib
import sys
# Our function to get the MD5 hash of a string
def getMD5Hash(textToHash=None):
return hashlib.md5(textToHash).hexdigest()
f = open(sys.argv[1], 'rb')
s = f.read()
f.close()
02-18 13:52:26.126 2159-2159/? E/JobServiceContext: Error sending onStart message to 'com.buglife.sdk.reporting.SubmitReportService'
android.os.TransactionTooLargeException: data parcel size 1268204 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:623)
at android.app.job.IJobService$Stub$Proxy.startJob(IJobService.java:108)
at com.android.server.job.JobServiceContext$JobServiceHandler.handleServiceBoundH(JobServiceContext.java:425)
at com.android.server.job.JobServiceContext$JobServiceHandler.handleMessage(JobServiceContext.java:355)
at android.os.Handler.dispatchMessa
BasicNetwork.performRequest: Unexpected response code 500 for https://www.buglife.com/api/v1/reports.json
02-19 20:28:05.569 8456-11621/io.digibyte D/com.Buglife: Error submitting report
java.util.concurrent.ExecutionException: com.android.volley.ServerError
at com.android.volley.toolbox.RequestFuture.doGet(RequestFuture.java:117)
at com.android.volley.toolbox.RequestFuture.get(RequestFuture.java:88)
at com.buglife.sdk.reporting.SubmitReportTask.execute(SubmitReportTask.java:53)
at com.buglife.sdk.reporting.SubmitReportAsyncTask.doInBackground(SubmitReportAsyncTask.java:35)
at com.buglife.sdk.reporting.SubmitReportAsyncTask.doInBackground(SubmitReportAsy
@FoamyGuy
FoamyGuy / foamyguy_circuitpython_2020.md
Last active January 11, 2020 20:01
Foamyguy - Circuit Python 2020

Foamyguy - Circuit Python 2020

I dipped my toes into the community about a year ago when I created the Android CircuitPython Editor and wrote the learn guide(my 1st!) for it. Admittedly, looking back it's something I wish I could've spent more time in 2019 on, but alas real life and work took up a bit more of my time.

One of the things that kept me busy was a project for work. We built an IO input board using a Trinket M0 as the brain. It takes trigger signals from a reed switch and sends them into an Android device that is playing video content on a nearby display. The trigger signals are ultimately used to play different content on the screen. We deployed around 200 of these in stores across the US. It was the first time we have deployed any custom hardware (albeit relatively basic!). The existence of the Micropython and CircuitPython ecosystems were a huge help in allowing us to do something like that with such li

"""
This test will initialize the display using displayio and draw a solid white
background, and a black pixel.
"""
import board
import displayio
import terminalio
from adafruit_display_text import label
import adafruit_displayio_ssd1306
# adafruit_requests usage with an esp32spi_socket
import board
import busio
from digitalio import DigitalInOut
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
from adafruit_esp32spi import adafruit_esp32spi
import adafruit_requests as requests
from secrets import secrets
# If you are using a board with pre-defined ESP32 Pins: