Skip to content

Instantly share code, notes, and snippets.

View thomas's full-sized avatar

Thomas Meeks thomas

  • Seattle, WA
View GitHub Profile
@thomas
thomas / example.java
Last active September 21, 2018 17:35
simple streaming example
final StreamsBuilder builder = new StreamsBuilder();
// Read the input Kafka topic into a KStream instance.
// The referenced 'Serde' objects are just serialization classes left out for brevity
KStream attempts = builder.stream("AttemptsTopic", Consumed.with(stringSerde, jsonMapSerde));
// Filter out our unauthenticated courses, because people playing around will skew the results
KTable reducedAttempts = questionAttempt.filter((k, v) -> v["free"] == false)
// group the attempts by course
.selectKey((k,v) -> v["course_id"])
class CourseProgress
# stores user_id and course_id columns, but no relationship
COURSE_COMPLETE = 1
def update_progress(new_progress)
self.progress = new_progress
save
end
def finished?
class User
has_many :course_progresses
def send_course_complete_email(course)
CourseCompleteMailer.new(self, course).send
end
end
class Course
has_many :course_progresses
@thomas
thomas / fix.diff
Created May 22, 2014 19:52
Debian Fix
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 72e9350..524ce5c 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -1985,7 +1985,9 @@ Init_ossl_ssl()
ossl_ssl_def_const(OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG);
ossl_ssl_def_const(OP_SSLREF2_REUSE_CERT_TYPE_BUG);
ossl_ssl_def_const(OP_MICROSOFT_BIG_SSLV3_BUFFER);
+#if defined(OP_MSIE_SSLV2_RSA_PADDING)
ossl_ssl_def_const(OP_MSIE_SSLV2_RSA_PADDING);