Skip to content

Instantly share code, notes, and snippets.

View Maccimo's full-sized avatar

Maxim Degtyarev Maccimo

View GitHub Profile
@Maccimo
Maccimo / Runner.java.diff
Created October 31, 2012 02:22
Running local runner and bot simultaneously
--- Runner.java;original 2012-10-31 06:10:12.658807200 +0400
+++ Runner.java 2012-10-31 02:12:01.058374400 +0400
@@ -7,11 +7,13 @@
public final class Runner {
private final RemoteProcessClient remoteProcessClient;
private final String token;
- public static void main(String[] args) throws IOException {
+ public static void main(String[] args) throws IOException, InterruptedException {
@Maccimo
Maccimo / Hello-full-main-onwards.log
Last active December 12, 2015 13:46
The dark side of the invokedynamic.
This file has been truncated, but you can view the full file.
-- VM Started --
====== main ======
Hello::main([Ljava/lang/String;)V
| @0000: getstatic java.lang.System.out Ljava/io/PrintStream; (17)
| java.lang.ClassLoader::checkPackageAccess(Ljava/lang/Class;Ljava/security/ProtectionDomain;)V
| | java.lang.System::getSecurityManager()Ljava/lang/SecurityManager;
| | java.util.Collections$SynchronizedCollection::add(Ljava/lang/Object;)Z
| | | java.util.HashSet::add(Ljava/lang/Object;)Z
| | | | java.util.HashMap::put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
| | | | | java.util.HashMap::hash(Ljava/lang/Object;)I
--- 278509.html 2016-03-07 08:32:37.670799200 +0300
+++ 278509-asya.html 2016-03-07 08:33:22.384356700 +0300
@@ -1,79 +1,54 @@
<div class="post_show">
<div class="post shortcuts_item" id="post_278509">
- <div class="published">вчера в 18:39</div>
+ <div class="published"> 3 марта в 18:39</div>
<h1 class="title">
@Maccimo
Maccimo / LambdaWithLVTT.java
Created May 20, 2016 05:04
LocalVariableTypeTable in lambda
import java.util.List;
public class LambdaWithLVTT {
void method(){
Runnable r = () -> {
List<String> list = null;
};
}
@Maccimo
Maccimo / Quiz.java
Last active April 7, 2017 21:17
Sberbank JPoint 2017 Quiz
// Source slightly modified.
class RGB {
final int r;
final int g;
final int b;
public RGB(int r, int g, int b) {
this.r = r;
(function() {
// Mark all comments on habrahabr as unread.
var nextNew = $("#xpanel .next_new");
var prevNew = $("#xpanel .prev_new");
var newCounter = $("#xpanel .new");
var allHeads = $(".comment__head");
var allComments = $(".content-list__item_comment");
allHeads.addClass("comment__head_new-comment");
! 26.07.2017, 11:15:41 https://habrahabr.ru/all/
habrahabr.ru##.promo-block_freelansim-tasks.promo-block
! 28.07.2017, 11:54:59 https://habrahabr.ru/all/
habrahabr.ru##.promo-block_vacancies.promo-block
! 15.08.2017, 15:42:50 https://geektimes.ru/post/292071/
geektimes.ru##.post-share
! 15.08.2017, 15:43:11 https://geektimes.ru/post/292071/
@Maccimo
Maccimo / VarFail.java
Last active September 19, 2019 02:15
`var` is a fail!
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.io.PrintStream;
public class VarFail {
public static void main(String... args) throws Throwable {
@Maccimo
Maccimo / 21524.MD
Last active May 20, 2020 00:50
A Java 1.5 enum class with 21_524 items

A Java 1.5 enum class with 21_524 items