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
#in bar folder | |
class Bar | |
class Baz | |
def hello | |
puts "hello from Baz" | |
end | |
end | |
end |
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
#sudo ngrep -d lo0 -q -W byline port ${PORT} | |
sudo ngrep -e -x -q port ${PORT} |
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 utils | |
import play.GlobalSettings | |
import com.google.inject.Injector | |
class GuiceGlobalSettings extends GlobalSettings { | |
var injector: Injector | |
override def onStart(application: play.Application) { |
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
public void something(X x, Y y) { | |
something(x, y, someDefaultValue); | |
} | |
public void something(X x, Y y, SomeObject object) { | |
// do work | |
} | |
// vs |
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
#! /bin/sh | |
M=META-INF/MANIFEST.MF | |
mkdir tmp | |
cd tmp | |
cp ../$1 . | |
JAR=$1 | |
jar xf ${JAR} |
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
function pr() { | |
if [ $# -lt 1 ] | |
then | |
echo "Error! Missing Pull Request ID #." | |
else | |
git fetch origin refs/pull/$1/head:pull-request-$1; | |
git checkout pull-request-$1; | |
fi | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am evanchooly on github. | |
* I am evanchooly (https://keybase.io/evanchooly) on keybase. | |
* I have a public key whose fingerprint is F6ED 714C AE5E 04DA 72EB AF52 B50B 4733 6F36 116A | |
To claim this, I am signing this object: |
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
public class WriteConcernTest { | |
public static void main(String[] args) throws InterruptedException { | |
MongoClient client = MongoClients.create(); | |
System.out.println(client.getSettings().getWriteConcern()); | |
client.getDatabase("test").getCollection("writeConcernTest").insertOne(new Document(), (result, t) -> System.out.println("DONE!")); | |
Thread.sleep(Long.MAX_VALUE); | |
} |
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
MongoClient client = MongoClients.create(MongoClientSettings.builder() | |
.clusterSettings(ClusterSettings.builder().hosts(Collections.singletonList(new ServerAddress("localhost"))).build()) | |
.writeConcern(WriteConcern.UNACKNOWLEDGED).build()); | |
System.out.println(client.getSettings().getWriteConcern()); | |
client.getDatabase("test").getCollection("writeConcernTest").insertOne(new Document(), (result, t) -> System.out.println("DONE!")); | |
Thread.sleep(Long.MAX_VALUE); |
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
list.stream().mapToInt(i -> i.intValue()).toArray() |
OlderNewer