Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ryan Hoo ryanhoo

🎯
Focusing
View GitHub Profile
@joinAero
joinAero / FlymeUtils.java
Created Feb 17, 2016
Android - Helper for 3rd party roms: Flyme & MIUI.
View FlymeUtils.java
package cc.cubone.turbo.core.rom;
import android.os.Build;
import android.view.Window;
import android.view.WindowManager;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
/**
View NestedScrollSwipeRefreshLayout.java
package com.segmentfault.app.view;
import android.content.Context;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.NestedScrollingChild;
import android.support.v4.view.NestedScrollingChildHelper;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;
import android.view.MotionEvent;
@jlmcdonnell
jlmcdonnell / BetterActivityLifecycleCallbacks
Last active Aug 29, 2015
Android - Better Activity lifecycle callbacks
View BetterActivityLifecycleCallbacks
/**
* This class allows you to listen to when the user is entering the background (i.e. after a home button press,
* or opening recent apps etc) and when the user resumes the application from the background.
*
* @author John McDonnell
*/
public class BetterActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
private int mForegroundActivities;
@homj
homj / GridSpanSizeLookupHelper.java
Last active Jun 16, 2020
A ItemDecoration to center the contents of a RecyclerView. This comes in handy when you want to build a responsive UI.
View GridSpanSizeLookupHelper.java
/*
* Copyright 2015 Johannes Homeier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@phelma
phelma / gist:ce4eeeedb8fb9a9e8e63
Last active Sep 12, 2019
Using Homebrew to manage Node.js and io.js installs on OSX
View gist:ce4eeeedb8fb9a9e8e63

(Deprecated) Using Homebrew to manage Node.js and io.js installs on OSX

Having both Node.js and io.js installed with NVM was giving me a load of problems, mainly with npm. So I uninstalled NVM and manage Node.js and io.js with homebrew.
Heres how.

Install Node.js and io.js

$ brew install node

@jaredrummler
jaredrummler / MenuTint.java
Last active Aug 26, 2019
Helper class to set the color and transparency for menu icons in an ActionBar or Toolbar.
View MenuTint.java
/*
* Copyright (C) 2015. Jared Rummler <jared.rummler@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@magicznyleszek
magicznyleszek / jekyll-and-liquid.md
Last active Oct 5, 2020
Jekyll & Liquid Cheatsheet
View jekyll-and-liquid.md

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@JakeWharton
JakeWharton / OkHttpStack.java
Created May 21, 2013
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
View OkHttpStack.java
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/
You can’t perform that action at this time.