Collection of kotlin script and kscript examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SIZE 40 | |
#define SPEED 30 | |
#include <DigiMouse.h> | |
void setup(){ | |
DigiMouse.begin(); | |
} | |
void loop() { | |
DigiMouse.update(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
println("Called with args:") | |
args.forEach { | |
println("- $it") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
04cbb896454312d3e20a05df1591658bcb57cde54131a09e7102d622023b7e47b14995d088d6e8d7a542908af7ce09584673b8cbbda4220b4bbfd7623b949bd5a7;xrigau |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
NewerOlder