Skip to content

Instantly share code, notes, and snippets.

View sssurvey's full-sized avatar
Javaing

Haomin sssurvey

Javaing
View GitHub Profile
private static LifecycleOwner mockLifecycleOwner() {
LifecycleOwner owner = mock(LifecycleOwner.class);
LifecycleRegistry lifecycle = new LifecycleRegistry(owner);
lifecycle.handleLifecycleEvent(Lifecycle.Event.ON_RESUME);
when(owner.getLifecycle()).thenReturn(lifecycle);
return owner;
}
@lukas-h
lukas-h / license-badges.md
Last active June 18, 2024 08:05
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@davidnunez
davidnunez / gist:1404789
Created November 29, 2011 13:20
list all installed packages in android adb shell
pm list packages -f