Skip to content

Instantly share code, notes, and snippets.

View swartzrock's full-sized avatar

Jason Swartz swartzrock

View GitHub Profile
@swartzrock
swartzrock / installation.asc
Last active August 29, 2015 14:03
Get Started With Scala
# Setup Instructions For Get Started With Scala
Today's course on getting started with Scala will require a bit of setup on your part. Having everything ready to go well before you show up will ensure that you will get the maximum value from our course.
## Physical Setup
You'll need to bring a working laptop with you.
## Java Setup
@swartzrock
swartzrock / bks2_code.sass
Created April 13, 2014 18:33
Bks2.com code styling
// Source Code boxes
.highlight, pre, .gist-data {
@include border-radius( 0 );
@include box-shadow(#bbb 0 0 6px);
code, .line-numbers, .line_data, .line_data pre, .line_numbers { font-size: 15px; line-height: 1.5em; }
.line-numbers, .line_numbers { background: #f6f6f6; color: #999; }
}
.code-title {
@swartzrock
swartzrock / sample.js
Last active December 20, 2015 09:18
Sample from Programming JavaScript Applications - Early Release from OReilly Books.
var highPass = function highPass(number, cutoff) {
if (number >= cutoff) {
return true;
} else {
return false;
}
},
lowPass = function lowPass(number, cutoff) {
if (number >= cutoff) {
@swartzrock
swartzrock / generateDatePeriods.scala
Last active December 14, 2015 16:58
Creating a list of DateTime's between two given dates based on an interval using List.tabulate()
val PRE_DST_DATE = "03/09/2013 19:00".toDateTime
val POST_DST_DATE = "03/10/2013 00:00".toDateTime
val interval = 15
val minutePeriods = Minutes.minutesBetween( PRE_DST_DATE, POST_DST_DATE ).getMinutes / interval
val datePeriods = List.tabulate[DateTime](minutePeriods)( minutes => PRE_DST_DATE.plusMinutes(minutes * interval) )
@swartzrock
swartzrock / SerialGraph.pde
Created June 24, 2011 04:52
Serial Graph with Processing and JFreeChart
import org.jfree.chart.*;
import org.jfree.chart.plot.*;
import org.jfree.chart.title.*;
import org.jfree.data.general.*;
import java.awt.*;
void showMeter(int value ) {