Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am demian0311 on github.
* I am demian0311 (https://keybase.io/demian0311) on keybase.
* I have a public key whose fingerprint is 144B 1BD6 7A70 37F1 BBDB 3ACA 1728 B19C 1979 9BCE
To claim this, I am signing this object:
@demian0311
demian0311 / Sevens.java
Created May 8, 2014 00:57
Rod's Interview Question
package interview;
import org.junit.Test;
import static org.junit.Assert.*;
import java.util.function.IntPredicate;
import java.util.stream.IntStream;
public class Sevens {
@demian0311
demian0311 / neidetcher_access_log.sh
Created May 3, 2014 11:55
What I use to capture data and create simple graphs for my site, this runs every minute via cron.
#!/bin/sh
name=neidetcher_access
rrdfile="/var/local/${name}.rrd"
imageDir="/home/demian/code/demian0311.github.com/_site"
case "$1" in
create)
rrdtool create $rrdfile --step 60 \
"DS:${name}:GAUGE:120:0:1000000" \
demian ~/boxes/foobox cat bootstrap.sh
#!/usr/bin/env bash
apt-get update
apt-get upgrade
apt-get install -y apache2
apt-get install -y vim
apt-get install -y git
#apt-get install -y tomcat7
apt-get install -y openjdk-7-jdk
@demian0311
demian0311 / gist:6261368
Last active December 21, 2015 05:59
Example shell script showing that Scala code really just compiles to Java and the resulting code can be run from Java if you include the scala-library.
rm -f *.class
rm -rf *.scala
echo 'object HelloWorld extends App{ println("hello world")}' > hw.scala
echo "## Scala source created"
cat hw.scala
echo "## Compiling Scala class"
scalac hw.scala