Skip to content

Instantly share code, notes, and snippets.

@jkutner
jkutner / gist:8457ecf8479d9f5f8472
Last active August 29, 2015 14:08
Javascript and Ebola

There was a time when Javascript was confined to the browser, much like Ebola was confined to a laboratory. The lab, like the browser, was a dangerous place. One could only enter after donning protective gear in the same way one must use JQuery. But those days are gone.

Ebola has escaped the lab. It's infected thousands of people in West Africa and literally billions of people in the United States. Likewise, Javascript has escaped the browser and runs on our servers and threatens our children.

It's too late to stop Ebola, but it's not too late to stop Javascript. All we need is a Javascript vaccine...

installing travis-1.7.0.gem
ERROR: Loading command: install (LoadError)
load error: jopenssl/load -- java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
org/jruby/ext/openssl/X509Cert.sign(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject; @140: invokevirtual
Reason:
Type 'org/bouncycastle/asn1/ASN1ObjectIdentifier' (current frame, stack[1]) is not assignable to 'org/bouncycastle/asn1/DERObjectIdentifier'
Current Frame:
bci: @140
@jkutner
jkutner / foo.rb
Last active August 29, 2015 14:03
class Foo
def self.my_attr(name, type, annotations=[])
annotations.each do |a|
java_annotation(a)
end
java_field "public #{type} #{name}"
end
my_attr :firstname, "String", ["Required"]
end
require 'java'
class Example
java_annotation 'Deprecated'
java_field "public java.lang.String abc"
def test0
to_java.abc = "quack"
end
@jkutner
jkutner / Avionics.md
Last active August 29, 2015 14:01
Feynman's Appendix to the Rogers Commission Report on the Space Shuttle Challenger Accident

The software is checked very carefully in a bottom-up fashion. First, each new line of code is checked, then sections of code or modules with special functions are verified. The scope is increased step by step until the new changes are incorporated into a complete system and checked. This complete output is considered the final product, newly released. But completely independently there is an independent verification group, that takes an adversary attitude to the software development group, and tests and verifies the software as if it were a customer of the delivered product. There is additional verification in using the new programs in simulators, etc. A discovery of an error during verification testing is considered very serious, and its origin studied very carefully to avoid such mistakes in the future. Such unexpected errors have been found only about six times in all the programming and program changing (for new or altered payloads) that has been done. The principle that is followed is that all the verif

$ echo "hello"
hello
$ cd ~
$ pwd
/home/tmux
> cd warbler
> ls
Gemfile LICENSE.txt Rakefile integration pom.xml warble.rb warbler.ipr
Gemfile.lock Mavenfile bin lib spec warbler.gemspec warbler.iws
import java.io.File;
public class FileDemo {
public static void main(String[] args) {
File f = null;
try{
// creates temporary file
21:09:17,019 ERROR [org.apache.catalina.connector] (ajp-/100.67.74.42:8159-6) JBWEB001018: An exception or error occurred in the container during the request processing: java.lang.NullPointerException
at org.jboss.as.web.session.ClusteredSession.update(ClusteredSession.java:973) [jboss-as-web-7.2.x.slim.tb3.incremental.2.jar:7.2.x.slim.tb3.incremental.2]
at org.jboss.as.web.session.DistributableSessionManager.loadSession(DistributableSessionManager.java:1389) [jboss-as-web-7.2.x.slim.tb3.incremental.2.jar:7.2.x.slim.tb3.incremental.2]
at org.jboss.as.web.session.DistributableSessionManager.findSession(DistributableSessionManager.java:681) [jboss-as-web-7.2.x.slim.tb3.incremental.2.jar:7.2.x.slim.tb3.incremental.2]
at org.jboss.as.web.session.DistributableSessionManager.findSession(DistributableSessionManager.java:84) [jboss-as-web-7.2.x.slim.tb3.incremental.2.jar:7.2.x.slim.tb3.incremental.2]
at org.apache.catalina.connector.Request.doGetSession(Request.java:2605) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
$ gem install nokogiri
...
Building native extensions. This could take a while...
...
checking for libxml/parser.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
...
$ be rake sunspot:mongo:reindex
reindexing Document
rake aborted!
RSolr::Error::Http - 500 Internal Server Error
Error: Severe errors in solr configuration.
Check your log files for more detailed information on what may be wrong.
If you want solr to continue after configuration errors, change: