Skip to content

Instantly share code, notes, and snippets.

View s4nchez's full-sized avatar

Ivan Sanchez s4nchez

View GitHub Profile
@s4nchez
s4nchez / watchr.rb
Created August 25, 2011 20:09
Watchr config for jasmine-node
watch('./(.*).js') { |m| run_tests }
def run_tests
output = `jasmine-node spec/`
report output rescue nil
end
def report(output)
tests = /[0-9]+ tests?/.match(output).to_s;
failures = /[0-9]+ failures?/.match(output).to_s;
@s4nchez
s4nchez / js_test.html
Created August 11, 2011 15:22
Basic JavaScript skills test
<html>
<head></head>
<body>
<input name="myButton" type="button" value="button 1">
<input name="myButton" type="button" value="button 2">
<input name="myButton" type="button" value="button 3">
<script type="text/javascript">
var buttons = document.getElementsByName("myButton");
@s4nchez
s4nchez / gist:1111657
Created July 28, 2011 14:41
IntelliJ IDEA Live Template for equals() and hashCode() using apache commons
@Override
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj.getClass() != getClass()) {
return false;
public static void main(String... args){
int i = 0;
for (i = 0; i < 10; i++) {
System.out.println("i=" + i);
}
System.out.println("final i=" + i);
}