Skip to content

Instantly share code, notes, and snippets.

View soundmasteraj's full-sized avatar

AJW soundmasteraj

  • Orbiting a virtual particle
View GitHub Profile
public class DemoPresenter extends DemoBasePresenter<DemoContract.View> implements DemoContract.Presenter {
@Inject
public DemoPresenter(DemoContract.View view) {
super(view);
}
@Override
public void unSubscribe() {
public interface DemoContract {
interface View extends DemoBaseContract.ActivityView {
}
interface Presenter extends DemoBaseContract.Presenter {
}
}
@Module
public abstract class DemoActivityModule {
@Binds
@PerActivity
abstract DemoContract.Presenter providesPresenter(DemoPresenter demoPresenter);
@Binds
@PerActivity
abstract DemoContract.View providesView(DemoActivity demoActivity);
}
@Module
public abstract class DemoActivityModule {
@Binds
@PerActivity
abstract DemoContract.Presenter providesPresenter(DemoPresenter demoPresenter);
@Binds
@PerActivity
abstract DemoContract.View providesView(DemoActivity demoActivity);
}
public class DemoActivity extends DemoBaseActivity<DemoContract.Presenter> implements DemoContract.View {
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo);
}
}
@soundmasteraj
soundmasteraj / python_decorator_guide.md
Created November 28, 2018 19:51 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@soundmasteraj
soundmasteraj / yes_no_with_attribs_ask.py
Created September 13, 2018 19:04
Tri boolean handling yes, no and doesn't exist with the AWS Lambda session object attributes and Alexa Endpoint
'''
(Python)
Using yes and no (intents) worked very well for me.
I enjoy coding for yes and no intents.
I found that users enjoy the experience and understand it intuitively.
The below variables derive from:
...
attributes_in = session['attributes'] <-- if session.get('attributes') <-- session obj
@soundmasteraj
soundmasteraj / README.md
Created April 13, 2018 09:12 — forked from stepheneb/README.md
Lab and LCh color spaces
@soundmasteraj
soundmasteraj / demo2.dart
Created April 10, 2018 21:09 — forked from nhancv/demo2.dart
Curves simulation
import 'dart:async';
import 'dart:ui' as ui;
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
class DemoPage extends StatefulWidget {
@override
@soundmasteraj
soundmasteraj / demo3.dart
Created April 5, 2018 20:52 — forked from nhancv/demo3.dart
Simple particle motion
import 'dart:ui' as ui;
import 'dart:async';
import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
class DemoPage extends StatefulWidget {