Skip to content

Instantly share code, notes, and snippets.

Jeff Sheets jeffsheets

Block or report user

Report or block jeffsheets

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jkuipers /
Last active Jan 20, 2020
RestTemplate-interceptor that logs outgoing requests and resulting responses
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpRequest;
import org.springframework.http.MediaType;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.http.client.ClientHttpRequestInterceptor;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.util.StreamUtils;
destan /
Last active Jan 17, 2020
Parse RSA public and private key pair from string in Java
import java.nio.file.Files;
import java.nio.file.Paths;
ygotthilf /
Last active Jan 20, 2020
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out
cat jwtRS256.key
paulirish /
Last active Jan 20, 2020
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.


Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
View resources.groovy
// Shameless stolen from
def config = Holders.config
def dataSources = config.findAll {
dataSources.each { key, value ->
def ds = value
rvillars /
Last active Feb 8, 2019
Spring bundle based translations (i18n) for AngularJS applications with angular-translate

angular-translate with Spring bundles


AngularJS itself doesn't provide any features to translate the texts of your application to different languages and switching the language right on the page. Fornutalty there is now another open-source project called angular-translate that implements the needed functionalities.

AnularJS proposes a technologiy where as much as possible application behevior is exeuted on the client (the browser). So it makes sense to hold translated texts clientside and enrich the static templates with the transalted texts there.

Spring message bundles in the opposite are a collection of serverside key=value files that hold the translated texts each for one language. A well known and widly used pattern.

willurd /
Last active Jan 21, 2020
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
You can’t perform that action at this time.