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
echo "Does my jvm output something reasonable for a PID equivalent?" | |
echo "public class Main{public static void main(String[]args){System.out.println(java.lang.management.ManagementFactory.getRuntimeMXBean().getName());}}" > Main.java | |
javac Main.java | |
java Main |
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.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Random; | |
/** | |
* sort_strat<ul> | |
* <li>0 random numbers - slowest by a factor of 5 than strat 2 or 3</li> | |
* <li>1 random numbers sort time included - by far the slowest, even NOT counting the sort time. This one is puzzling.</li> | |
* <li>2 incrementing numbers - same as 2</li> |
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
############################################################################### | |
# Globals-ish | |
export VISUAL=vim | |
export EDITOR=vim | |
export JAVA_HOME=`/usr/libexec/java_home` | |
############################################################################### | |
# Bash |
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/bash | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: | |
# * the active virtualenv | |
# * the branch/status of the current git repository | |
# * the return value of the previous command | |
# * the fact you just came from Windows and are used to having newlines in | |
# your prompts. |
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
/* Root build.gradle for Java, Maven, and IntelliJ with Maven central POM. Assumes GitHub. | |
You should eventually read through and understand this entire Gradle script. Last tried with IntelliJ 2017.1. | |
Quick start: | |
- Copy this file into a directory named for your project. | |
- Choose one Gradle integration mode. Once chosen, stick to it. | |
IntelliJ Gradle integration: | |
- Import the project directory as a Gradle project. | |
- To change Gradle files, enable auto-synchronize or click the synchronize button in the Gradle panel. |
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
SAMPLE_DEPENDENCY="jersey-core" | |
find . -type f -name build.gradle -exec dirname {} \; \ | |
| gxargs -I{} gradle -p {} dependencyInsight --dependency ${SAMPLE_DEPENDENCY} |
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
val client = Client.create(new DefaultClientConfig( | |
classOf[ScalaJacksonJsonProvider] | |
)) | |
class ScalaJacksonJsonProvider extends JacksonJsonProvider(new ObjectMapper().registerModule(DefaultScalaModule)) {} | |
// sample usages | |
val stringResult = client.resource("http://localhost:8080/service").get(new GenericType[String](){}) |
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
var http = require('http'); | |
http.createServer(function(req, res) { | |
res.writeHead(200); | |
res.end(req.socket.remoteAddress); | |
}).listen(8080, '0.0.0.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
/** | |
* Usage: | |
* <pre> | |
* $scope.refresh = new DelayedSearch({ | |
* immediate: function() { | |
* // always do this immediately | |
* // e.g. show refreshing indicator | |
* }, | |
* delayMs: 200, | |
* delayed: function() { |
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
/* | |
The MIT License (MIT) | |
Copyright (c) 2017 Jason Dunkelberger (aka "dirkraft") | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
OlderNewer