Skip to content

Instantly share code, notes, and snippets.

@jesslilly
jesslilly / Cake.java
Last active August 29, 2015 13:57
Jetty, Jersey, Guice, JAXB Sample
// See http://blog.bdoughan.com/2011/06/using-jaxbs-xmlaccessortype-to.html
@XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
@XmlRootElement
public class Cake implements PlainTextBean {
private String type;
// The getter is up here since the order of fields affects the order in the
// xml.
public String getType() {
return type;
<p>The files that could have been potentially accessed included a ton of sensitive information: SSL keys, database passwords with read/write access to our production databases, basically everything you never want a third party to see. Somebody with access to the database could replace npm modules with malicious payloads. I don't want to blur the truth here: this could have been a disaster. It is very much like the <a href="http://venturebeat.com/2013/01/30/rubygems-org-hacked-interrupting-heroku-services-and-putting-millions-of-sites-using-rails-at-risk/">rubygems.org security breach</a> in early 2013, and we are similarly lucky that the effect was not much much worse.</p>
<p>Thankfully, there's no evidence that, other than ourselves, the engineers who reported the bugs, and a few members of the GitHub security team who knew about the issue, anyone knew about this hole. But, in the interests of transparency, we should be clear that we can't <strong>prove</strong> that: the logs we kept at the time were not su
@jesslilly
jesslilly / Hello.groovy
Last active August 29, 2015 13:57
Just a little groovy exploration
#!/usr/bin/env groovy
// GROOVY STYLE!!!!!!!!!!!!!!!!
def a = new ArrayList<String>()
a.add("Hello")
a.add("my")
a.add("name")
a.add("is")
a.add("Jess")
@jesslilly
jesslilly / stack.js
Created March 16, 2014 02:28
Stack with push, pop, and min all of complexity O(1). With unit tests.
#!/usr/bin/env node
/*
* Design a stack with a push, pop, and min method.
* Min returns the smallest element.
* All methods must operate in O(1) time.
* I implemented this with simple numbers, but I could enhance it
* to use objects with a comparator function.
*/
$ find node_modules -name 'README*' | xargs wc -c | tail -1
531452 total
$ find static -type f | xargs wc -c | tail -1
820587 total