Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Plugin Name: Custom Registration Fields
Plugin URI:
Description:
Version: 0.1
Author: CSSIgniter
Author URI:
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@aemxn
aemxn / dl_image.py
Created October 20, 2020 08:00
Download image with interval
import requests
import shutil
import time
import time
import threading
def dl():
image_url = "https://p3.fgies.com/bucket-pnb/PNB-11.jpg"
filename_jpeg = image_url.split("/")[-1]
filename_ts = filename_jpeg.split(".")[0]
@aemxn
aemxn / open-source-imageboard
Created December 11, 2019 15:08
Open source imageboard
https://github.com/kennell/imageboards
https://github.com/blobmon/simplechan
https://gitgud.io/LynxChan/LynxChan
https://github.com/VVatashi/TinyIB
https://github.com/bakape/meguca
https://github.com/lalcmellkmal/doushio
https://github.com/underr/shoganai
https://github.com/sougai/chakai
https://github.com/vampiricwulf/ex-tanoshiine
https://github.com/praetorg/uchan
@aemxn
aemxn / BasePresenter.java
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
aemxn / LoginActivity.java
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;
@Override
protected void onCreate(Bundle savedInstanceState) {
@aemxn
aemxn / LoginRepositoryImpl.java
Created August 23, 2017 16:02
Implementation for LoginRepository
package com.myapp.core.data.repository.impl;
public class LoginRepositoryImpl implements Repository<Login> {
private DatabaseRealm databaseRealm;
public LoginRepositoryImpl(DatabaseRealm databaseRealm) {
this.databaseRealm = databaseRealm;
}
@aemxn
aemxn / Repository.java
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
aemxn / RemoteView.java
Created August 23, 2017 15:50
Generic view base class
public interface RemoteView {
void showProgress();
void hideProgress();
void showUnauthorizedError();
void showEmpty();
@aemxn
aemxn / LoginPresenter.java
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,