Skip to content

Instantly share code, notes, and snippets.

View Palatis's full-sized avatar

Victor Tseng Palatis

View GitHub Profile
@Palatis
Palatis / QT_DEBUG_PLUGINS=1 telegram-desktop
Created April 22, 2023 15:53
telegram-desktop 4.8 scroll crash logs
qt.core.plugin.factoryloader: checking directory path "/snap/telegram-desktop/4743/usr/plugins/platforms" ...
qt.core.plugin.factoryloader: looking at "/snap/telegram-desktop/4743/usr/plugins/platforms/libqeglfs.so"
qt.core.plugin.loader: Found metadata in lib /snap/telegram-desktop/4743/usr/plugins/platforms/libqeglfs.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"eglfs"
]
},
@Palatis
Palatis / gradle.properties
Created November 1, 2020 11:48
gradle ramdisk cache
org.gradle.daemon = true
org.gradle.caching = true
android.buildCacheDir = Z:/gradle/build-cache
@Palatis
Palatis / BindingFragment.java
Last active September 10, 2021 16:07
generic android DataBinding Fragment super class
public class BindingFragment<BindingT extends ViewDataBinding> extends Fragment {
private BindingT mBinding = null;
private boolean mSuperCalled = false;
protected BindingT getBinding() {
return mBinding;
}
@Nullable
@Override
@Palatis
Palatis / MultilineHintTextInputLayout.java
Last active June 24, 2017 01:00
MultilineHintTextInputLayout :-D
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.annotation.StringRes;
import android.support.design.widget.TextInputLayout;
@Palatis
Palatis / .gitignore
Created June 19, 2017 09:44
archive output APK (AS 3.0 rc4)
/archive
@Palatis
Palatis / CustomToolbar.java
Created June 16, 2017 14:49
CustomToolbar with custom Title/Subtitle and NavIcon views
public class CustomToolbar extends android.support.v7.widget.Toolbar {
private static final String TAG = "CustomToolbar";
public CustomToolbar(Context context) {
this(context, null);
}
public CustomToolbar(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
@Palatis
Palatis / TheActivity.java
Created April 24, 2017 11:42
RecyclerView recycle test
package com.fitivision.iot.p2p.ui;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
byte oldState = HIGH;
time_t downMillis = 0;
time_t lastTickMillis = 0;
void loop() {
byte state = digitalRead(BTN);
if (oldState != state) {
if (state == LOW) {
clock.tick(); // button just pressed, tick the first time...
lastTickMillis = downMillis = millis();
}
#ifndef __ADCMUX_HPP__
#define __ADCMUX_HPP__
#include <Arduino.h>
#include <cstdarg>
extern "C" int system_adc_read();
#ifndef ADC_RESOLUTION_BITS
#include <Arduino.h>
#include <FS.h>
#include <i2s.h>
#include <opusfile_spiffs.hpp>
#define SAMPLE_RATE_HZ (32000)
void setup() {