Skip to content

Instantly share code, notes, and snippets.

@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
@meoyawn
meoyawn / EmptyRecyclerView.java
Created November 1, 2014 11:20
RecyclerView doesn't have an emptyView support, we gotta fix that
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class EmptyRecyclerView extends RecyclerView {
@Nullable View emptyView;
@krishan711
krishan711 / RecyclerViewAdapter
Created December 20, 2014 13:15
RecyclerView with headers and footers
/*
* Created by Krishan Patel.
* Copyright (c) 2014. Rocko Labs Ltd. All Rights Reserved.
*/
package com.rockolabs.kites.adapters;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
@swillits
swillits / NSDICT.m
Last active May 2, 2023 13:48
Obj-C NSDictionary Literal-like syntax allowing nil values
/*
---------------------------------------------------------------------------------------
Obj-C Literal Dictionary Syntax - Multiple reasons for allowing nil values
Radar 19747372
---------------------------------------------------------------------------------------
The obj-c literal syntax for dictionaries does not allow nils.
@{key : nil}; // Exception (and compiler error)
@wong2
wong2 / cmds.txt
Last active May 2, 2021 12:13
在任意聊天中输入。 [ ]表示后面要跟一个空格(可能还需要别的参数才能生效)
//wearversion
//wearlog
//wearvoiceinputenable
//wearvoiceinputdisable
//weargoogleapi
//assert
//pushassert
//uplog
//upcrash
//switchnotificationstatus
@polbins
polbins / README.md
Last active June 20, 2022 02:50
Android Studio as default Git Diff Tool

Create Android Studio Command-line Launcher

  1. Open Android Studio
  2. Go to: Tools > Create Command-line Launcher
  3. Leave as default, Press OK

Configure Git to use Android Studio as default Diff Tool

  1. Add the following lines to your .gitconfig
@MRezaNasirloo
MRezaNasirloo / TextViewCompatTint.java
Last active May 24, 2021 06:37
A Backward Compatible TextView drawableTint
package com.github.pedramrn;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;
import com.github.pedramrn.slick.parent.R;
@ndunks
ndunks / paste-symlink.ps1
Created September 30, 2017 06:25
Windows 10 Add Copy-Paste as Symbolic Link or Junction
@xujiaao
xujiaao / android-set-ntp-server.md
Last active July 22, 2024 03:51
Set the NTP server of your android device
tags
Android
Android Things

Set the NTP server of your android device

@DzeryCZ
DzeryCZ / Run (.exe) WSL Without Extension
Created April 13, 2018 21:17
Run Windows Programs (.exe) from WSL as Fallback without extension
# Add at the end of your ~/.bashrc file this content:
# Run Windows Programs (.exe) from WSL as Fallback without extension
eval "$(echo "orig_command_not_found_handle()"; declare -f command_not_found_handle | tail -n +2)"
command_not_found_handle()
{
cmd=$1
shift
args=( "$@" )