Skip to content

Instantly share code, notes, and snippets.

View vexdev's full-sized avatar

Luca Vitucci vexdev

  • Zürich, Switzerland
View GitHub Profile
@vexdev
vexdev / adam6050.py
Created October 23, 2021 11:53 — forked from petez69/adam6050.py
Emulate Advantech ADAM-6050 for Synology Surveillance Station
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
import time
import RPi.GPIO as GPIO
#import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
for x in range(2, 7):
GPIO.setup(x, GPIO.OUT)
@vexdev
vexdev / LaunchActivity.java
Created May 7, 2015 00:04
Really simple activity to be tested with Android Unit Test
package com.example.android.testingfun;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
/**
* Launches NextActivity and passes a payload in the Bundle.
@vexdev
vexdev / build.gradle
Last active August 29, 2015 14:20
Example configuration for an app using Android Unit Test
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
minSdkVersion 18
}
}
@vexdev
vexdev / LaunchActivityTest.java
Last active May 22, 2018 10:52
Example Android Unit Test,
package com.example.android.testingfun;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import org.junit.Before;
import org.junit.Test;
@vexdev
vexdev / LaunchActivity.java
Created May 6, 2015 22:42
Example modified from AOSP of an Activity to be Unit Tested.
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@vexdev
vexdev / LaunchActivity.java
Created May 6, 2015 22:37
Example modified from AOSP of an Activity to be Unit Tested.
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@vexdev
vexdev / build.gradle
Created May 6, 2015 22:27
Example Gradle file for an Android Unit Test app
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
minSdkVersion 18
}