Skip to content

Instantly share code, notes, and snippets.

View Kisty's full-sized avatar

Timothy Kist Kisty

View GitHub Profile
@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
@matthewmccullough
matthewmccullough / gist:988077
Created May 24, 2011 03:02
Visualize Git Orphans via gitk and log
# Put this in your .gitconfig file under the alias section
orphank = !gitk --all `git reflog | cut -c1-7`&
# Then run it by typing 'git orphank' on the command line.
# A text version of the same is
orphanl = !git --pretty=oneline --abbrev-commit --graph --decorate `git reflog | cut -c1-7`
@JakeWharton
JakeWharton / AndroidManifest.xml
Created August 5, 2011 03:05
How to use ActionBarSherlock tab style on native TabWidget.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.actionbarsherlock.sample.stylenativetabs"
android:versionCode="1"
android:versionName="1.0.0">
<uses-sdk android:minSdkVersion="4" />
<application android:label="Styled Native Tabs" android:theme="@style/Theme.Sherlock">
@christopherperry
christopherperry / adb+
Created July 30, 2012 16:12
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
@christopherperry
christopherperry / SwipeLinearLayout.java
Created August 27, 2012 18:38
Android LinearLayout that handles left swipes.
import android.content.Context;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.widget.LinearLayout;
public class SwipeLinearLayout extends LinearLayout {
private GestureDetector gestureDetector;
private OnSwipeListener listener;
package com.example.checkableviews;
/*******************************************************************************
* Copyright 2013 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
@oginorasta
oginorasta / Intellij Shortcut list
Last active October 28, 2022 08:45
All the shortcuts I know and use in Intellij Idea resp. Android Studio. v 1.0
Strg Alt Shift Key Function
x Einf Generate/Insert dialog
x x ENTER Statements completion like blocks and brackets
x x T Surrond codeblock with…
x W Select succesively increasing code blocks
x F11 bookmarks and mark the line with selected key
x F11 invokes a list of bookmarks. Pressing a key takes to associated bookmark.
x x Backspace go to most recent code edit. Hit again to go even further back.
x E recent opened files
x x E recent edited files

Make your multiple type view adapter with annotations!

Gist for Making a Multiple View Types Adapter With Annotations

Pretty easy to use.

  1. Create your delegate adapters, implementing DelegateAdapter, and with the annotation DelegateAdapterType. e.g:
@DelegateAdapterType(itemType = 0)
package com.mohammedlakkadshaw.ken;
import java.util.Vector;
import org.xml.sax.XMLReader;
import android.text.Editable;
import android.text.Html;
import android.text.Spannable;
import android.text.style.BulletSpan;
@romannurik
romannurik / CharsPerLineActivity.java
Last active December 17, 2021 03:15
Demonstrates how to identify and avoid line-length issues with TextView. The measure, or characters per line, of a block of text plays a key role in how comfortable it is to read (sometimes referred to as readability). A widely accepted optimal range for a text block's measure is between 45 and 75 characters. This code demonstrates two phases of…
/*
* Copyright 2013 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