Skip to content

Instantly share code, notes, and snippets.

@li2
li2 / ThreeLevelExpandableListView.java
Created March 20, 2018 11:52
[A 3 level expandable list view] #tags: android-list
package net.stf.threelevelexpandablelistview;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.ExpandableListView;
@li2
li2 / usbreset.c
Created March 20, 2018 11:51
usbreset -- send a USB port reset to a USB device, compile using: gcc -o usbreset usbreset.c
/**
* usbreset -- send a USB port reset to a USB device
* Compile using: gcc -o usbreset usbreset.c
*/
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
@li2
li2 / category_plugin.rb
Last active May 6, 2018 11:48
[How I organize posts in Jekyll (code snippets for blog post - see comments)] #tags: tool
module Jekyll
Page.class_eval {
def clone
Page.new(@site, @base, @dir, @name)
end
}
@li2
li2 / introrx.md
Last active June 17, 2018 09:21
[The introduction to Reactive Programming you've been missing] #tags: rx
@li2
li2 / c.md
Last active March 20, 2018 04:48
lambda #tags: java

@li2
li2 / c.md
Last active March 20, 2018 06:58
[gitk : View the details changed history of an individual file using Git versioning] https://goo.gl/NvJUD9 #tags: git

For this I'd use:

gitk [filename]

or to follow filename past renames

gitk --follow [filename]

@li2
li2 / c.md
Last active March 20, 2018 07:02
[Git Feature Branch Workflow] The core idea behind the Feature Branch Workflow is that all feature development should take place in a dedicated branch instead of the master branch. #tags: git

The core idea behind the Feature Branch Workflow is that all feature development should take place in a dedicated branch instead of the master branch. This encapsulation makes it easy for multiple developers to work on a particular feature without disturbing the main codebase. It also means the master branch will never contain broken code, which is a huge advantage for continuous integration environments.

pull requests make it incredibly easy for your team to comment on each other’s work.

link: Git Feature Branch Workflow

Start with the master branch

git checkout master

@li2
li2 / c.md
Last active March 20, 2018 07:03
git remote: determine the URL that a local Git repository was originally cloned from #tags: git

If referential integrity has been broken:

git config --get remote.origin.url

If referential integrity is intact:

git remote show origin
@li2
li2 / c.md
Last active March 20, 2018 10:55
Jira workflow #tags: agile

//Jira workflow

Jira workflow

@li2
li2 / iterm2-solarized.md
Last active March 20, 2018 04:40 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + Powerlevel9k - (macOS) #tags: tool

Default

Default

Powerlevel9k

Powerlevel9k