Skip to content

Instantly share code, notes, and snippets.

Plugin Name: Custom Registration Fields
Plugin URI:
Version: 0.1
Author: CSSIgniter
Author URI:
License: GPLv2 or later
License URI:
aemxn /
Created October 20, 2020 08:00
Download image with interval
import requests
import shutil
import time
import time
import threading
def dl():
image_url = ""
filename_jpeg = image_url.split("/")[-1]
filename_ts = filename_jpeg.split(".")[0]
aemxn / open-source-imageboard
Created December 11, 2019 15:08
Open source imageboard
aemxn /
Created August 24, 2017 02:27
Presenter base class
public abstract class BasePresenter<V extends RemoteView> {
private WeakReference<V> view = null;
public final void attachView(V view) {
if (view == null) throw new NullPointerException("View must not be null");
if(this.view != null) detachView(this.view.get());
this.view = new WeakReference<V>(view);
aemxn /
Created August 23, 2017 16:09
Login activity ui
package com.myapp.ui.home;
public class LoginActivity extends BaseActivity implements LoginContract.LoginView {
// field declaration
private LoginPresenter presenter;
protected void onCreate(Bundle savedInstanceState) {
aemxn /
Created August 23, 2017 16:02
Implementation for LoginRepository
public class LoginRepositoryImpl implements Repository<Login> {
private DatabaseRealm databaseRealm;
public LoginRepositoryImpl(DatabaseRealm databaseRealm) {
this.databaseRealm = databaseRealm;
aemxn /
Created August 23, 2017 15:52
Repository interface base class
public interface Repository<T> {
T find(String guid);
List<T> findAll();
void add(T item);
void add(List<T> items);
aemxn /
Created August 23, 2017 15:50
Generic view base class
public interface RemoteView {
void showProgress();
void hideProgress();
void showUnauthorizedError();
void showEmpty();
aemxn /
Created August 23, 2017 14:37
Login presenter
package com.myapp.core.mvp.home.login;
public class LoginPresenter extends BasePresenter<LoginContract.LoginView> implements LoginContract.ViewAction {
private APIManager apiManager;
private PreferenceService preference;
private INetworkManager networkManager;
private Repository<Login> eventRepository;
public LoginPresenter(APIManager apiManager, PreferenceService preference,