Objective-C block syntax
bash test format and flags
vim macro create and execute
I noticed I could never remember these, so I always make aliases, shell functions, or short ~/bin/ scripts for them instead:
netstat flags (other than "-tulpn" which I have memorized as "tull-pin" like "Tolkien")
ssh tunnel syntax
Edit: *in one-line.
Array to list:
String array = ...;
List<String> immutableList = Arrays.asList(array);
List<String> mutableList = new ArrayList<String>(Arrays.asList(array));
List to array:
List<String> list = ...;
String array = list.toArray(new String[list.size()]);
Clear as mud...
Helpful protip. I learned yesterday, that list.toArray(new String) is faster than the version with the explicit size given.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.