Skip to content

Instantly share code, notes, and snippets.

🍉
Hey there! I am using GitHub.

Matteo Mazzarolo mmazzarolo

🍉
Hey there! I am using GitHub.
Block or report user

Report or block mmazzarolo

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
@mmazzarolo
mmazzarolo / FloatingActionMenuBehavior.java
Last active Mar 21, 2019
Floating Action Menu Behavior for Clans.FloatingActionButton
View FloatingActionMenuBehavior.java
import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorListener;
import android.util.AttributeSet;
import android.view.View;
import com.github.clans.fab.FloatingActionMenu;
@mmazzarolo
mmazzarolo / FloatingActionMenuBehavior.java
Last active Apr 10, 2018
Floating Action Menu like Inbox
View FloatingActionMenuBehavior.java
import android.content.Context;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorListener;
import android.util.AttributeSet;
import android.view.View;
import com.github.clans.fab.FloatingActionMenu;
@mmazzarolo
mmazzarolo / FirebaseRecyclerAdapter.java
Last active Feb 22, 2018
RecyclerView adapter that handles a Firebase location listener
View FirebaseRecyclerAdapter.java
package com.example.matteo.firebase_recycleview;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.ViewGroup;
import com.firebase.client.ChildEventListener;
import com.firebase.client.DataSnapshot;
import com.firebase.client.FirebaseError;
View Default (Linux).sublime-keymap
[
{ "keys": ["f12"], "command": "reindent", "args": {"single_line": false} },
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
]
},
View TouchableView.js
import React, { PropTypes } from 'react'
import { Platform, View, TouchableNativeFeedback, TouchableOpacity } from 'react-native'
const IS_ANDROID = Platform.OS === 'android'
const IS_RIPPLE_EFFECT_SUPPORTED = Platform.Version >= 21 && IS_ANDROID
const TouchableView = ({ isRippleEnabled, children, style, ...props }) => {
if (IS_RIPPLE_EFFECT_SUPPORTED && !isRippleEnabled) {
const background = TouchableNativeFeedback.Ripple(null, false)
return (
View LoadingSpinner.js
/**
* @providesModule LoadingSpinner
*/
import React, { ActivityIndicatorIOS, Platform, ProgressBarAndroid, StyleSheet } from 'react-native'
const IS_ANDROID = Platform.OS === 'android'
export default ({ ...props }) => IS_ANDROID
? <ProgressBarAndroid style={styles.spinner} {...props} />
: <ActivityIndicatorIOS style={styles.spinner} {...props} />
View Checkbox.js
//
// MDL-style Checkbox component.
//
// - @see [MDL Checkbox](http://www.getmdl.io/components/index.html#toggles-section/checkbox)
// - [Props](#props)
// - [Defaults](#defaults)
// - [Built-in builders](#builders)
//
// Created by ywu on 15/12/13.
//
@mmazzarolo
mmazzarolo / configureStore.js
Created Apr 18, 2016
Cleaning up the messy seamless-immutable functions in redux-logger
View configureStore.js
import createLogger from 'redux-logger'
// Seamless-Immutable logger cleanup
const stateTransformer = (state) => {
if (typeof state === 'object' && state !== null && Object.keys(state).length) {
let newState = {}
for (var i of Object.keys(state)) {
if (state[i].asMutable) newState[i] = state[i].asMutable({ deep: true })
else newState[i] = state[i]
}
@mmazzarolo
mmazzarolo / 0info.js
Last active Aug 11, 2016
NavigationExperimental setup
View 0info.js
// Redux navigations tore
{
key: '1',
index: 0,
children: [{ key: 'museumList', title: 'I musei' }],
isDrawerOpen: false
}
// Navigation structure
You can’t perform that action at this time.