Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ssk2 on github.
  • I am ssk2 (https://keybase.io/ssk2) on keybase.
  • I have a public key whose fingerprint is C1D4 5282 D8B8 584F 8BC8 F608 F498 1949 7CCE DBD0

To claim this, I am signing this object:

@ssk2
ssk2 / config.json
Last active August 29, 2015 14:15 — forked from ConnorDoyle/config.json
{
"masters": ["10.141.141.10:5050"],
"refreshSeconds": 20,
"ttl": 20,
"domain": "mesos",
"port": 53,
"resolvers": ["8.8.8.8"],
"timeout": 5
}
from subprocess import Popen
import time
import random
while True:
# Start mesos-slave
print "STARTING SLAVE"
proc = Popen (["/usr/local/sbin/mesos-slave", "--master=zk://54.196.175.189:2181/mesos", "--log_dir=/var/log/mesos"])
wait_time = (random.random() * 60) + 60
time.sleep(wait_time)
package mesosphere.marathon.tasks
import javax.inject.Inject
import mesosphere.marathon.MarathonConf
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.util.Stats
import org.apache.log4j.Logger
import org.apache.mesos.state.State
@ssk2
ssk2 / gist:6979550
Last active December 25, 2015 12:49
MaxConsecutiveSum solution in linear time for Coding For Interviews. http://codingforinterviews.com/
package cfi.maxconsecutivesum;
public class MaxConsecutiveSum {
public static void main(String[] args) {
int[] input = new int[] { -1, 5, 6, -2, 20, -50, 4 };
System.out.println(getMaxConsecutiveSumLinear(input));
}
public static int getMaxConsecutiveSumLinear(int[] input) {