Skip to content

Instantly share code, notes, and snippets.


Mocoven mocovenwitch

  • Sydney, Australia
Block or report user

Report or block mocovenwitch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mocovenwitch / StateMachine
Created Sep 27, 2017 — forked from elandau/StateMachine
Rx based state machine
View StateMachine
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.Observable.OnSubscribe;
mocovenwitch / note.txt
Created May 30, 2017
Share link in Facebook post without integrate with Facebook sdk
View note.txt
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.putExtra(Intent.EXTRA_TEXT, "");
startActivity(Intent.createChooser(sharingIntent, "Share via"));
mocovenwitch / Activity
Created May 3, 2017
Manage Fragment when rotating
View Activity
public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
if (getFragmentManager().findFragmentById( == null) {
getFragmentManager().beginTransaction().replace(, new MainActivityFragment()).commit();
mocovenwitch /
Created Apr 4, 2017 — forked from jaydeepw/
Enabling HTML5 AppCache in Android Webview programatically.
private void enableHTML5AppCache() {
// Set cache size to 8 mb by default. should be more than enough
// This next one is crazy. It's the DEFAULT location for your app's cache
// But it didn't work for me without this line
webView.getSettings().setAppCachePath("/data/data/"+ getPackageName() +"/cache");
View gist:1c85246cc6332fa2e0dc1cb7c2c35e08
# I have both python 2.7 and 3.6 running in my Mac
# working with python 2.7
sudo pip install plotpy
# working with python 3.6
sudo pip3 install plotly
You can’t perform that action at this time.