Skip to content

Instantly share code, notes, and snippets.

$("#page-container").prepend($("<span>").html($(".tweet-text:contains(℃)").map(function(){return $(this).closest(".content").find(".stream-item-header .time .tweet-timestamp").attr("title") + "," + /\d\d.\d℃/.exec($(this).text())}).toArray().join("<br>")))
2:49 AM - 7 Jun 2017,38.0℃
2:08 AM - 7 Jun 2017,37.6℃
11:35 PM - 6 Jun 2017,37.0℃
10:17 PM - 6 Jun 2017,37.1℃
7:03 PM - 6 Jun 2017,37.6℃
6:04 PM - 6 Jun 2017,37.5℃
4:31 PM - 6 Jun 2017,37.1℃
1:44 PM - 6 Jun 2017,37.1℃
@terazzo
terazzo / gist:1523010
Created December 27, 2011 08:16
Kraepelin w/ foldLeft
def f(g:(Int,Int)=>Int,x:List[Int]) = x match {
case head::tail => tail.foldLeft((head,List[Int]())){(acc,i)=>(i,g(i,acc._1)::acc._2)}._2.reverse
case Nil => Nil
}
println(f({_+_},List(1,2,3,4,5)))
package sample.jparsec;
import static org.junit.Assert.assertEquals;
import java.util.List;
import org.codehaus.jparsec.*;
import org.codehaus.jparsec.functors.*;
import org.junit.Test;
public class JparsecSample {