Skip to content

Instantly share code, notes, and snippets.

@neroanelli
neroanelli / shadowsocks
Last active April 12, 2021 21:11
shadowsocks for tomato firmware.
#!/bin/sh
BIN=shadowsocks
RUN_D=/var/run
ss_local_PID_FILE=$RUN_D/ss-local.pid
ss_redir_PID_FILE=$RUN_D/ss-redir.pid
ipset_blacklist="/opt/etc/ipset/blacklist"
ipset_whitelist="/opt/etc/ipset/whitelist"
file="/opt/etc/config/shadowsocks"
COND=$1
@romannurik
romannurik / DrawInsetsFrameLayout.java
Created February 10, 2014 16:28
DrawInsetsFrameLayout — adding additional background protection for system UI chrome when using KitKat’s translucent decor flags.
/*
* Copyright 2014 Google Inc.
*
* 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
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* 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
SDK_HOME_PATH="$HOME"
SDK_PATH="$SDK_HOME_PATH/android-sdk-linux"
# Needs to be updated when new releases are made
SDK_DOWNLOAD_URL="http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz"
curl --location $SDK_DOWNLOAD_URL | tar -xz -C $SDK_HOME_PATH
# Just install platform-tools, build-tools & Android-19
# Filter names are from `android list sdk -e -a`
@chrisbanes
chrisbanes / SystemUiHelper.java
Last active March 2, 2024 18:57
SystemUiHelper
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
@darnmason
darnmason / HeaderViewRecyclerAdapter.java
Last active March 21, 2020 17:19
RecyclerView adapter designed to wrap an existing adapter allowing the addition of header views and footer views.
/*
* Copyright (C) 2014 darnmason
*
* 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
@lapastillaroja
lapastillaroja / DividerItemDecoration.java
Last active November 17, 2023 23:06 — forked from akmalxxx/DividerItemDecoration.java
DividerItemDecoration. RecyclerView.ItemDecoration simple implementation
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
@nschwermann
nschwermann / ProgressView
Last active June 14, 2018 08:39
Material ProgressView
/*
* Copyright (C) 2013 The Android Open Source Project
*
* 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
@shekaroppo
shekaroppo / percent_relative_layout.xml
Last active August 29, 2015 14:23
Played with all new PercentRelativeLayout, its very easy to build complex UI structure using percentage concept now. Everything will be scaled automatically on different screen size.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
style="@style/match">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
style="@style/match"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />