Skip to content

Instantly share code, notes, and snippets.

View atermenji's full-sized avatar

Artur Termenji atermenji

View GitHub Profile
@fredbenenson
fredbenenson / kickstarter_sql_style_guide.md
Last active April 2, 2024 15:19
Kickstarter SQL Style Guide
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

@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
@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@lucasr
lucasr / GridAndListLayout.java
Last active March 29, 2017 15:35
Mixed grid/list layout built with the new TwoWayView API
public class GridAndListLayout extends TwoWayLayoutManager {
private final int NUM_LANES = 2;
public GridAndListLayout(Context context, Orientation orientation) {
super(context, orientation);
}
private boolean isGridItem(int position) {
return position < 4;
}
@gabrielemariotti
gabrielemariotti / Activity.java
Last active November 27, 2022 09:27
Floating Action Button (requires Android-L preview)
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layoutfab);
//Outline
int size = getResources().getDimensionPixelSize(R.dimen.fab_size);
Outline outline = new Outline();
@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
#!/bin/bash
PACKAGE=$1
DATABASE_NAME=$2
adb shell "run-as $PACKAGE cat databases/$DATABASE_NAME > /sdcard/$DATABASE_NAME"
adb pull /sdcard/$DATABASE_NAME
@kevinsawicki
kevinsawicki / instructions.md
Last active August 29, 2015 13:56
Style hyperlinks in Atom
  • Open Atom
  • Click the Atom > Open Your Stylesheet menu item
  • Paste code below
.editor .markup.underline.link.hyperlink {
  color: #F9EE98;
  text-decoration: underline;
}
@ignasi
ignasi / db_getter.sh
Created January 30, 2014 11:43
Get database from an Android app (Android 4.3+)
#!/bin/bash
# Android 4.3+ changes app's internal directory permissions and you can not just pull your
# databases to your computer, so I did this as a workaround to extract my databases.
# I only use it for debug, use it under your responsability.
package=$1
db_name=$2
path="/data/data/$package/"
@ignasi
ignasi / resizer-xxhdpi.sh
Last active February 7, 2021 15:29
Android XXHDPI Resizer (Tested on OS X Mavericks)
#!/bin/bash
f=$(pwd)
mkdir drawable-mdpi drawable-hdpi drawable-xhdpi drawable-xxhdpi
# fake argv and argc in bash
argc=$#; argv[0]=$0 # argv[0] is a prog name
for foo in $( seq $argc )
do