Skip to content

Instantly share code, notes, and snippets.

View platisd's full-sized avatar
:octocat:
(づ。◕‿‿◕。)づ

Dimitris Platis platisd

:octocat:
(づ。◕‿‿◕。)づ
View GitHub Profile
@platisd
platisd / libtorch_1.2.0.bb
Last active August 27, 2019 15:05
pytorch dependencies
SUMMARY = "Facebook PyTorch AI"
DESCRIPTION = "Facebook PyTorch AI"
HOMEPAGE = "https://pytorch.org/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=acf4d595f99e159bf31797aa872aef57"
S = "${WORKDIR}"
LOCAL_INCLUDE = "${S}/libtorch/include"
LOCAL_LIB = "${S}/libtorch/lib"
TARGET_INCLUDE = "${D}${includedir}"
@platisd
platisd / clasic_solution.cpp
Created August 19, 2019 09:21
Putting stuff into a container
std::list<MicroscopeLedColor> colors;
for (const auto& color : well["color"])
{
colors.push_back(microscopeledcolor::userInputToColor(color).value());
}
@platisd
platisd / DroidXMain.cpp
Last active August 11, 2019 12:30
DroidXMain snippets
// Hook up via HIDL to communicate with AOSP
KeyMessageReaderWriterQueue frameworkIncomingQueue;
AospCommunicationClient aospCommunicationClient(frameworkIncomingQueue, logger);
android::hardware::configureRpcThreadpool(1 /*threads*/, true /*willJoin*/);
android::sp<vendor::cellink::commodule::V1_0::ICommunicationModule> communicationServer{&aospCommunicationClient};
if (communicationServer->registerAsService() != android::OK)
{
logger.writeErrorLog("Failed to register ICommunicationModule HIDL service");
return 1;
}
@platisd
platisd / flask_app.py
Last active March 17, 2022 05:48
A sample Flask server for my Google Assistant tutorial on Instructables.com
#!/usr/bin/python3
# -*- coding:utf8 -*-
import json
from flask import Flask, request, make_response, jsonify
app = Flask("My-Local-Traffic-Planner")
def respond(fullfilment):
return make_response(jsonify({'fulfillmentText': fullfilment}))
@platisd
platisd / Aptiv.md
Last active May 3, 2018 13:02
C&SE Hackathon 2018 - Aptiv case

Aptiv logo

A phone/workstation/living room on wheels

Software is increasingly becoming the differentiating factor in the automotive industry. This has motivated automakers to adopt the latest trends from different domains so to offer the most pristine experience to the users of their vehicles. Furthermore, the higher the degree of automated driving the more possibilities there shall be for the driver and the passengers to utilize the car for more than transportation. In the meanwhile, we see the emergence of home automation technologies such as Google Home, Alexa etc which smarten up your routines and turn your mobile handset into an facilitator of your daily life. Now your car wants to be part of this ecosystem too!

The case

Android Automotive aspires to connect your vehicle further with the world and enable it to seamlessly stay up to date with the latest trends in the mobile world, disrupting the rather stale tec

@platisd
platisd / simple_rest_server.py
Last active December 21, 2017 00:38
A simple REST server written in Python and Flask
"""
A very simple REST server using Python and Flask.
Install dependencies:
* pip3 install flask flask-jsonpify flask-sqlalchemy flask-restful
Usage:
GET movement and light for <node id>: http://localhost:5000/node/<node id>
POST movement and light for <node id>: http://localhost:5000/node/<node id>/<movement>/<light>
"""
@platisd
platisd / watchdog_blink.ino
Created December 20, 2017 16:17
Blinking LED with watchdog
@platisd
platisd / findfile
Last active May 9, 2019 12:24
Useful util scripts placed in my /usr/local/sbin/
#!/usr/bin/env bash
STRING=$1
if [ -z "$STRING" ]
then
echo "Enter as string to look for, e.g.: findfile main.cpp"
exit 1
fi
STRING=\'*$@*\'
eval find . -iname $STRING 2>/dev/null
@platisd
platisd / MultipleSR04.ino
Last active July 4, 2017 08:11
Calling ultrasonics in sequence example
#include <Smartcar.h>
SR04 front, back;
unsigned int d1 = 0;
unsigned int d2 = 0;
void setup() {
front.attach(3, 4); //trigger pin, echo pin
back.attach(6,7);
@platisd
platisd / README.md
Last active December 30, 2016 11:01
Pillbox docs

Pillbox flowchart

An abstract overview of the system's operation (some details missing)

Flowchart

Pillbox schematic

Schematic

Pillbox breadboard view

Breadboard