Skip to content

Instantly share code, notes, and snippets.

import android.arch.lifecycle.Observer;
import android.support.annotation.Nullable;
public abstract class IgnorantObserver<T> implements Observer<T>{
private boolean isIgnoring = false;
private boolean doingIgnorantly = false;
public IgnorantObserver(){
this(false);
}
@adam-currie
adam-currie / contains.h
Created December 30, 2021 18:55
checks if a container contains an item eg: strings>>contains("hello")
#pragma once
template<typename T>
class contains {
const T& item;
public:
contains(const T& item) : item(item) {}
template<typename C>
@adam-currie
adam-currie / lendx
Last active May 26, 2022 19:20
runs a command as another user with current users x server
#!/bin/bash
selfBaseName=$(basename -- "$(readlink -f -- "$0")")
usage="Usage: ${selfBaseName} <username> <command>"
if test $# -ne 2; then
echo $usage
exit
fi