Skip to content

Instantly share code, notes, and snippets.

View rekire's full-sized avatar

René Kilczan rekire

View GitHub Profile
@rekire
rekire / bus.c
Created March 13, 2024 21:13
My auto login linux sample code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libsecret/secret.h>
#define SERVICE_NAME "eu.rekisoft.flutter.autologin.example"
#define AUTOLOGIN_SCHEMA getAutologinSchema()
const SecretSchema* getAutologinSchema (void){
static const SecretSchema autologinSchema = {
@rekire
rekire / libsecret-password-demo.c
Created March 13, 2024 21:12
Sample implementation how to read and write credentials with lib secret
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libsecret/secret.h>
#define SERVICE_NAME "your.service.name"
#define MY_SCHEMA getMySchema()
const SecretSchema* getMySchema (void){
static const SecretSchema mySchema = {
@rekire
rekire / main.dart
Created September 8, 2023 16:52
Demonstration of "my" keyboard bug
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
@rekire
rekire / gist:e43738672cb9d2a243a55024fa4c59ee
Created August 15, 2023 08:23
Regex seach for useless overrides which just call super
\{\s+super\.[^)]+\);\s+}
@rekire
rekire / url_parser.dart
Created March 28, 2022 20:33
A very simple url parser for RichText written in dart
static int findEnd(String string, int start) {
int index = string.indexOf(">", start);
if (index == -1) {
return string.length -1;
} else {
return index;
}
}
static List<TextSpan> parseHtml(String html) {
@rekire
rekire / MailChecker.java
Last active July 7, 2020 21:03
Implementation for validating email addresses, it supports IDN domains and it checks if the domain has a mx record. It requires the xbill lib (http://www.xbill.org/dnsjava/).
/**
* @copyright
* This code is licensed under the Rekisoft Public License.
* See http://www.rekisoft.eu/licenses/rkspl.html for more informations.
*/
package eu.rekisoft.android.util;
import java.net.IDN;
import java.util.Arrays;
@rekire
rekire / request.json
Created May 9, 2018 12:16
The fulfillment request of Dialogflow of an Actions on Google request.
{
"originalRequest": {
"data": {
"isInSandbox": true,
"surface": {
"capabilities": [ // Wear OS (former Android Wear)
{
"name": "actions.capability.SCREEN_OUTPUT"
}
],
@rekire
rekire / FirebaseAnalytics.java
Created February 12, 2017 16:13
Firebase analytics mock.
package com.google.firebase.analytics;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
/**
* Created by René Kilczan on 12.02.17.
*/
public class FirebaseAnalytics {
@rekire
rekire / MeasureCallbackLayout.java
Created December 23, 2016 06:15
A small layout to observe measure calls to know when the layout dimentions are fixed.
public class MeasureCallbackLayout extends FrameLayout {
private final List<MeasureCallback> listeners = new ArrayList<>();
private int width = -1;
private int height = -1;
public MeasureCallbackLayout(Context context) {
super(context);
}
public MeasureCallbackLayout(Context context, AttributeSet attrs) {
@rekire
rekire / IterableSparseArray.java
Last active February 11, 2019 13:35
Customized SparseArray which allows using a iterator.
/**
* @copyright
* This code is licensed under the Rekisoft Public License.
* See http://www.rekisoft.eu/licenses/rkspl.html for more informations.
*/
/**
* @package eu.rekisoft.android.util
* This package contains utils provided by [rekisoft.eu](http://rekisoft.eu/).
*/
package eu.rekisoft.android.util;