Skip to content

Instantly share code, notes, and snippets.

@ranarula
ranarula / price_estimate
Last active August 27, 2020 04:42
ADBE price guess
// Chougarigiri's price estimate for ADBE price on Jan 2, 2021
//Poll done on Aug 26,2020
C: 620
R: 566
A: 650
P: 590
@ranarula
ranarula / CheckedException.java
Last active April 3, 2019 17:01
hide checked exception
//Erase checked exception for seemless use in lambdas
// source https://bytex.solutions/2017/07/java-lambdas/
//Step 1.
@FunctionalInterface
interface SilentInvoker {
MethodType SIGNATURE = MethodType.methodType(Object.class, Callable.class);//signature of method INVOKE
<V> V invoke(final Callable<V> callable);
}
@ranarula
ranarula / pr.md
Created October 9, 2018 22:13 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@ranarula
ranarula / JavaStreamExceptions.java
Created October 9, 2018 22:12 — forked from dimaKudr/JavaStreamExceptions.java
Hide checked exceptions in Java Streams
public static <T> T uncheckCall(Callable<T> callable) {
try { return callable.call(); }
catch (Exception e) { return sneakyThrow(e); }
}
public static void uncheckRun(RunnableExc r) {
try { r.run(); } catch (Exception e) { sneakyThrow(e); }
}
public interface RunnableExc { void run() throws Exception; }