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:
tar: xkcd.com/1168/
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[0]) is faster than the version with the explicit size given.
list.toArray(new String[0])
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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:
tar: xkcd.com/1168/
netstat flags (other than "-tulpn" which I have memorized as "tull-pin" like "Tolkien")
ssh tunnel syntax
Edit: *in one-line.
Array to list:
List to array:
Clear as mud...
Helpful protip. I learned yesterday, that
list.toArray(new String[0])
is faster than the version with the explicit size given.