Skip to content

Instantly share code, notes, and snippets.

View rolandostar's full-sized avatar

Rolando Romero rolandostar

View GitHub Profile
{
"$id": "https://tts.swlegion.dev/ObjectState.json",
"$schema": "http://json-schema.org/draft-07/schema",
"title": "ObjectState",
"type": "object",
"properties": {
"Name": {
"type": "string",
"default": "",
"description": "Internal object name."
@rolandostar
rolandostar / AndroidClipboard.kt
Last active December 21, 2020 17:58
Get clipboard content when entering activity
/*
According to the Android lifecycle, clipboard contents cannot be accesed in either onCreate, onResume and neither onRestart.
As such, they can only be accessed when the activity's layout is fully formed
*/
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
val textToPaste: String = clipboard?.primaryClip?.getItemAt(0)?.text.toString().trim()
Log.d(TAG, textToPaste)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <pthread.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/sem.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>