Skip to content

Instantly share code, notes, and snippets.

View Artaud's full-sized avatar

Jiří Richter Artaud

  • Urbandroid Team
  • Prague, Czech Republic
View GitHub Profile
source build/envsetup.sh
m -j CtsVerifier
python3 /usr/bin/repo sync
python3 /usr/bin/repo init -u https://android.googlesource.com/platform/manifest -b android-security-10.0.0_r58
mkdir projectDir
cd projectDir
sudo apt-get update
sudo apt-get install repo
@Artaud
Artaud / jobWorker.ts
Last active May 31, 2024 16:47
Basic worker thread pool in Feathers, using threads.js
import { expose } from "threads/worker"
const jobWorker = {
async doMyJob() {
console.log('Hello from worker thread!')
}
}
export type JobWorker = typeof jobWorker
expose(jobWorker)
@Artaud
Artaud / jobWorker.ts
Last active February 27, 2021 05:46
Worker threads in FeathersJS
import { expose } from "threads/worker"
import app from '../../app'
const jobWorker = {
async doMyJob() {
const reports: Report[] = await app.service('reports').create()
}
}
static void start_accelerometer() {
sensor_type_e type = SENSOR_ACCELEROMETER;
int max_batch_latency = 30000; // 300 is max queue, 100 ms is default period
if (sensor_get_default_sensor(type, &sensor) == SENSOR_ERROR_NONE)
{
   if (sensor_create_listener(sensor, &listener) == SENSOR_ERROR_NONE
&& sensor_listener_set_max_batch_latency(listener, max_batch_latency) == SENSOR_ERROR_NONE
       && sensor_listener_set_event_cb(listener, 100, accelerometer_sensor_event_callback, NULL) == SENSOR_ERROR_NONE
    && sensor_listener_set_option(listener, SENSOR_OPTION_ALWAYS_ON) == SENSOR_ERROR_NONE
@Artaud
Artaud / kai-ads.service.ts
Created October 2, 2019 10:01
Include KaiAds in Angular
import { Injectable } from '@angular/core';
import * as kaiAds from '../../../assets/js/kaiads.min.js'
@Injectable({
providedIn: 'root'
})
export class KaiAdsService {
publisherId: string = 'XXXXXX'
testing: false
@Artaud
Artaud / _sleepbot-migrate-to-sleep_as_android.rb
Last active January 15, 2017 15:25 — forked from T3chArmy/readme
Migrates SleepBot data to Sleep as Android's format. Updated by the author of Sleep as Android.
require 'csv'
# Parses CSV-exported data from SleepBot
def parse_export(row)
# Parse the wake up date
date_to = row[0].tr("'","").split('-')
date_to = Time.new(date_to[2].to_i, date_to[1], date_to[0])
# Parse the wake up/sleep times
time_from = row[1].tr("'","").split(':')