(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/bin/bash | |
ADBShell () { adb ${2+-s }$2 shell "$1" | tr -d '\r' | |
} | |
GetAndroidVersion () { | |
local ALL_TAGS=$(wget -qO - "$GOOGLE_SOURCE/$REPO/+refs/tags/?format=text" | \ | |
tr -d '^{}' | cut -d/ -f3 | sort -u | grep -vE -- '-(cts|sdk)-' | grep -v "_r0") | |
TAG=${1:-$(ADBShell 'getprop ro.build.version.release')} | |
echo -e "ANDROID_SERIAL=$ANDROID_SERIAL\nro.build.version.release=$TAG" 1>&2 |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
package java8tests ; | |
import java.util.function.BiFunction ; | |
import java.util.function.Function ; | |
public class Currying { | |
public void currying() { | |
// Create a function that adds 2 integers | |
BiFunction<Integer,Integer,Integer> adder = ( a, b ) -> a + b ; |
/* | |
* packet-adb.c | |
* | |
* Routines for Android Debug Bridge (ADB) protocol dissection | |
* Author: Geir Sporsheim <[email protected]> | |
*/ | |
#ifdef HAVE_CONFIG_H | |
#include "config.h" | |
#endif |
# View the log to find the commit you want to edit: | |
git log | |
# Quit out of the log | |
q | |
# Rebase from the commit you want to edit, in interactive mode: | |
git rebase SOME_COMMIT_ID^ --interactive | |
# This will open an interactive menu in Vi |
from adb import protocol | |
data = ( | |
'\x4f\x50\x45\x4e\x02\x00\x00\x00' | |
'\x00\x00\x00\x00\x09\x00\x00\x00' | |
'\x31\x03\x00\x00\xb0\xaf\xba\xb1' | |
'\x73\x68\x65\x6c\x6c\x3a\x6c\x73' | |
'\x00' | |
) |
Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118
Your problem with Vim is that you don't grok vi.
You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).
The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:
0 go to the beginning of this line. y yank from here (up to where?)