Skip to content

Instantly share code, notes, and snippets.

@shitchell
shitchell / git-user-stats
Last active June 25, 2024 09:03
Show user stats in a git repo
#!/bin/bash
#
# Show user stats (commits, files modified, insertions, deletions, and total
# lines modified) for a repo
git_log_opts=( "$@" )
git log "${git_log_opts[@]}" --format='author: %ae' --numstat \
| tr '[A-Z]' '[a-z]' \
| grep -v '^$' \
@ypresto
ypresto / FragmentItemIdStatePagerAdapter.java
Created July 13, 2015 14:28
Modified FragmentStatePagerAdapter which correctly handles reordering of items and saved states. Original issue: https://code.google.com/p/android/issues/detail?id=37990
/*
* Copyright (C) 2011 The Android Open Source Project
* Copyright (C) 2015 Yuya Tanaka
*
* 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
*
@ScottCooper92
ScottCooper92 / gist:ea11b690ba4b1278e049
Created May 4, 2015 22:17
Example of the various YouTube url formats
http://www.youtube.com/watch?v=-wtIMTCHWuI
http://www.youtube.com/v/-wtIMTCHWuI?version=3&autohide=1
http://youtu.be/-wtIMTCHWuI
http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3D-wtIMTCHWuI&format=json
http://s.ytimg.com/yt/favicon-wtIMTCHWuI.ico