Skip to content

Instantly share code, notes, and snippets.

View danieljue's full-sized avatar
💭
I may be slow to respond.

Daniel Jue danieljue

💭
I may be slow to respond.
View GitHub Profile
@danieljue
danieljue / dynamodb-janusgraph-storage-backend-cfn-partial.yaml
Created March 15, 2018 22:49
A partial script for installing the dynamo-db janusgraph EC2 instance via aws cloud formation. Paste this into your dynamodb-janusgraph-storage-backend-cfn.yaml, replacing the existing one. Fixes a java mismatch with maven during gremlin install.
UserData:
Fn::Base64:
Fn::Join:
- ''
- - "#!/bin/bash\n"
- "export SDKMAN_DIR=/usr/local/sdkman && curl -s https://get.sdkman.io | bash && source /usr/local/sdkman/bin/sdkman-init.sh\n"
- "echo 'export SDKMAN_DIR=/usr/local/sdkman; source /usr/local/sdkman/bin/sdkman-init.sh' > /etc/profile.d/sdkman.sh\n"
- "yum update -y && yum upgrade -y && yum install -y java-1.8.0-openjdk > /home/ec2-user/yumupdates.log\n"
- "yum remove -y java-1.7.0-openjdk > /home/ec2-user/yumremovejava7.log\n"
- "java -version > /home/ec2-user/java-version-before-sdkmvn.log\n"
@danieljue
danieljue / JVMHelper.java
Created January 18, 2014 16:10
ThreadLocalImmolater lifted from somewhere online. I apply it in the Neo4J shutdown hook, to clean up Neo4J threads on hot Tomcat redeploys (Running Neo4J embedded in a web app). Note that you would apply this after calling graph.shutdown(). It is intended to clean up threads that are left behind after attempting a graceful shutdown of the regis…
public class JVMHelper {
private static final Runtime runtime = Runtime.getRuntime();
/**
* Aggressively suggest to free memory, then return the amount of free
* memory in the system.
*
* @return
*/
@danieljue
danieljue / all.js
Created April 9, 2013 17:07
This is a combination and refresh of the Neovigator/Askken code. All pjs files were combined into one (for debugging purposes). I've found that Processing 2.0b8 is not translating the pde into proper JavaScript. The all.js file is the contents of the this.sourceCode variable that ProcessingJS creates. Note on all.js line 972 (and other lines) th…
// this code was autogenerated from PJS
(function($p) {
var ModifiedEulerIntegrator = (function() {
function ModifiedEulerIntegrator() {
var $this_1 = this;
function $superCstr(){$p.extendClassChain($this_1)}
$this_1.s = null;
function step$1(t) {
$this_1.s.clearForces();
$this_1.s.applyForces();