This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assertThrows(MyException.class, | |
() -> systemUnderTest.throwingMethod()); | |
// now do other testy things |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn versions:display-dependency-updates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
${:importStatic(com.google.common.base.Preconditions.checkNotNull)}${var} = checkNotNull(${var}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
${:import(java.util.Objects)} | |
@Override | |
public boolean equals(Object obj) { | |
if (obj == null) { | |
return false; | |
} | |
if (!(obj instanceof ${enclosing_type})) { | |
return false; | |
} | |
${enclosing_type} other = (${enclosing_type}) obj; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
for i := 0; i < 100; i++ { | |
m3 := i % 3 == 0 | |
m5 := i % 5 == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> brew cask install java | |
$> brew install kafka | |
$> vim ~/bin/kafka | |
# ~/bin/kafka | |
#!/bin/bash | |
zkServer start | |
kafka-server-start.sh /usr/local/etc/kafka/server.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__ _____ | |
___ ___ _____ ___ ___ __ __/ /____ ___ / _/ /__ _____ ________ | |
/ _ `/ // / _ \(_-</ _ \/ // / __(_-</ _ \/ _/ __/ |/|/ / _ `/ __/ -_) | |
\_, /\_,_/_//_/___/\___/\_,_/\__/___/\___/_/ \__/|__,__/\_,_/_/ \__/ | |
/___/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user = User.find(user_id).skip_confirmation! | |
user.save! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -size +10000k -exec ls -lh {} \; | awk '{ print $0 ": " $5 }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first find the process using top | |
top -H | |
# find the java process | |
top - 15:32:53 up 1 day, 2:20, 1 user, load average: 1.28, 1.17, 1.18 | |
Tasks: 2355 total, 2 running, 2353 sleeping, 0 stopped, 0 zombie | |
Cpu(s): 26.4%us, 1.4%sy, 0.0%ni, 66.1%id, 5.7%wa, 0.0%hi, 0.2%si, 0.2%st | |
Mem: 16332248k total, 9613508k used, 6718740k free, 312148k buffers | |
Swap: 1048572k total, 0k used, 1048572k free, 1858716k cached |
NewerOlder