Skip to content

Instantly share code, notes, and snippets.

View josericardo's full-sized avatar

José Ricardo josericardo

  • Campo Grande/MS, Brazil
  • 13:19 (UTC -04:00)
View GitHub Profile
@josericardo
josericardo / tre-ruby-install
Last active August 29, 2015 14:14
tre-ruby install
apt-get install libtre5 libtre-dev
gem install tre-ruby
@josericardo
josericardo / joblib_eg.py
Created November 14, 2014 02:02
Joblib parallel's usage example
from math import sqrt
from joblib import Parallel, delayed
Parallel(n_jobs=2)(delayed(sqrt)(i ** 2) for i in range(10))
@josericardo
josericardo / gist:891fc4219ee899e16e87
Last active August 29, 2015 14:06
How to run a clojure file/script using leiningen
If you’re taking your first steps in the clojure world and just want to try out some commands. Assuming you are using leiningen and have already created a project using lein new, you have two options:
1. Fire a REPL
That’s easy:
$ lein repl
The downside of this option is that lein, AFAIK, doesn’t allow us to save the session contents to a file.
@josericardo
josericardo / PageableCollection.java
Last active September 26, 2023 06:21
Helper to iterate over pageable sources. Should reduce memory usage when querying large tables via Spring Data.
======================================
Usage:
Fetcher<Source, MyEntity> f = new Fetcher<Source, MyEntity>(source) {
@Override
public List<MyEntity> fetch(Pageable pageRequest)
{
return source.findAll(pageRequest);
}
};