Skip to content

Instantly share code, notes, and snippets.

@kennyk
kennyk / gource export
Created Feb 1, 2021
Export gource rendering to ppm mp4
View gource export
gource \
-s 30 \
-1280x720 \
--multi-sampling \
--stop-at-end \
--highlight-users \
--font-size 25 \
--output-ppm-stream - \
--output-framerate 30 \
--logo ~/Downloads/favicon.png \
@kennyk
kennyk / rapsberry_pi_streaming
Last active May 1, 2019
Notes on live streaming from raspberry pi
View rapsberry_pi_streaming
Thanks https://johnvoysey.wordpress.com/2014/05/07/raspberry-pi-camera-live-streaming/
libx264
Compiling the libx264 library from source is relatively straightforward. You will need git installed to check out the latest version. Use the following commands to check out, compile & install libx264:
git clone git://git.videolan.org/x264.git
cd x264/
./configure --enable-static --enable-shared
make
make install
@kennyk
kennyk / gist:8104728b5d9be2b5fc33ca4688693ba3
Last active Feb 20, 2018
Delete local copies of remote branches
View gist:8104728b5d9be2b5fc33ca4688693ba3
Branches that are local only will not be touched.
Branches that have been deleted on remote but were not merged will show a notification but not be deleted on local.
If you want to delete those as well change `-d` to `-D`.
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d
View clear_intent_flag.java
public static void unsetFlag(Intent intent, int flag) {
intent.setFlags(intent.getFlags() & (~flag));
}
@kennyk
kennyk / gist:04da1c2411911376d85c
Last active Aug 29, 2015
Batch delete git tags
View gist:04da1c2411911376d85c
#delete all remote tags containing "v0"
git ls-remote | grep tags | grep v0 | awk '/^(.*)(\s+)(.*[a-z])/ {print ":" $2}' | grep -v \{ | xargs git push origin
#delete all local tags containing "v0"
git tag -l | grep v0 | awk '/^(.*[a-z])/ {print $1}' | xargs git tag -d
@kennyk
kennyk / gist:1bd8143831ef9c5c97eb
Created Dec 1, 2014
org.lucasr.twowayview.sample.LayoutAdapter#onBindViewHolder
View gist:1bd8143831ef9c5c97eb
@Override
public void onBindViewHolder(final SimpleViewHolder holder, int position) {
holder.title.setText(mItems.get(position).toString());
boolean isVertical = (mRecyclerView.getOrientation() == TwoWayLayoutManager.Orientation.VERTICAL);
final View itemView = holder.itemView;
final int itemId = mItems.get(position);
if (mLayoutId == R.layout.layout_staggered_grid) {