Skip to content

Instantly share code, notes, and snippets.

View danybony's full-sized avatar

Daniele Bonaldo danybony

View GitHub Profile
@danybony
danybony / mouse-jiggler-with-timeout.ino
Created December 13, 2023 23:33
DigiMouse Arduino jiggler with timeout
#define SIZE 40
#define SPEED 30
#include <DigiMouse.h>
const int inputPin = 2;
int buttonState;
int lastButtonState = LOW;
unsigned long lastDebounceTime = 0; // the last time the output pin was toggled
unsigned long debounceDelay = 50; // the debounce time; increase if the output flickers
@danybony
danybony / mouse-jiggler.ino
Created February 10, 2023 12:28
DigiMouse Arduino jiggler
#define SIZE 40
#define SPEED 30
#include <DigiMouse.h>
void setup(){
DigiMouse.begin();
}
void loop() {
DigiMouse.update();
@danybony
danybony / _KotlinScript.md
Last active December 23, 2019 09:21
Kotlin script and kscript

Collection of kotlin script and kscript examples

@danybony
danybony / arguments.kts
Last active December 20, 2019 11:37
Kotlin script and kscript
println("Called with args:")
args.forEach {
println("- $it")
}
@danybony
danybony / screenshot_android.sh
Last active June 30, 2021 12:05
Android screenshot to current dir
#!/bin/bash
while getopts y: flag
do
case "${flag}" in
y) size=${OPTARG};;
esac
done
DEVICES=`adb devices | grep -v devices | grep device | cut -f 1`
04cbb896454312d3e20a05df1591658bcb57cde54131a09e7102d622023b7e47b14995d088d6e8d7a542908af7ce09584673b8cbbda4220b4bbfd7623b949bd5a7;xrigau
@danybony
danybony / install_all.sh
Created August 21, 2017 10:24
Install all APKs from a dir
total=$(ls -1 apps/*.apk | wc -l)
counter=0
for app in apps/*.apk; do
counter=$((counter+1))
echo $counter/$total - Installing $app
adb install -r $app
echo
done
@danybony
danybony / RainbowLightsActivity.java
Created December 28, 2016 23:47
Android Things sample activity showing how to read and toggle some LEDs in response
public class RainbowLightsActivity extends Activity {
private static final String TAG = RainbowLightsActivity.class.getSimpleName();
private List<Gpio> buttons = new ArrayList<>();
private Map<Color, Gpio> leds = new HashMap<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
package com.ryanharter.mediaroute.widgets;
import android.content.Context;
import android.support.v7.app.MediaRouteActionProvider;
import android.support.v7.app.MediaRouteButton;
/**
* A MediaRouteActionProvider that allows the use of a ThemeableMediaRouteButton.
*/
public class ThemeableMediaRouteActionProvider extends MediaRouteActionProvider {
@danybony
danybony / startbuild.sh
Created November 29, 2014 18:25
Setup and start AOSP build with ccache and build target passed as parameter
#!/bin/bash
function show_help {
echo "Usage:"
echo "./startbuild.sh -t <build_target> [-c -h]"
echo
echo "Parameters:"
echo "-t: specify the build target as per lunch (required)"
echo "-c: perform a clean build, calling make clean"
echo "-h: show this"