This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Linux / Mac | |
echo 'java.lang.System.out.println("Hello World")' | java -cp ${JAVA_HOME}/lib/tools.jar com.sun.tools.script.shell.Main | |
# Windows | |
echo java.lang.System.out.println("Hello World") | java -cp %JAVA_HOME%/lib/tools.jar com.sun.tools.script.shell.Main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// anser for: http://stackoverflow.com/questions/26656427/how-to-extract-tar-gz-including-multi-byte-characters-and-prohibited-characters | |
package tar; | |
import org.apache.tools.tar.*; | |
import java.io.*; | |
import java.nio.file.*; | |
import java.util.zip.GZIPInputStream; | |
public class Targz { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sub.optimal.benchmark; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Map; | |
import java.util.Random; | |
import java.util.Set; | |
import java.util.concurrent.TimeUnit; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.Fork; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>sub.optimal</groupId> | |
<artifactId>SquirrelSqlCLI</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<maven.compiler.source>1.7</maven.compiler.source> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sometimes the autohide of the Windows taskbar doesn't work anymore | |
# and the taskbar is showed permanently | |
# | |
# beside killing and restarting the explorer.exe process it's enough | |
# forcing to display a new tooltip | |
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | |
[reflection.assembly]::loadwithpartialname("System.Drawing") | |
$notify = new-object system.windows.forms.notifyicon | |
$notify.icon = [System.Drawing.SystemIcons]::Information | |
$notify.icon = [System.Drawing.SystemIcons]::Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static java.lang.System.out; | |
import java.lang.reflect.Field; | |
import java.util.AbstractList; | |
import java.util.ArrayList; | |
/** | |
* Related to an answer to this Twitter post | |
* https://twitter.com/JosePaumard/status/864938907183480832 | |
* | |
* @author Frank Dietrich <Frank.Dietrich@gmx.li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script demonstrates the ability to capture and tamper with Web sessions. | |
For secure sessions, this is done by dynamically writing certificates to match the requested domain. | |
This is only proof-of-concept, and should be used cautiously, to demonstrate the effects of such an attack. | |
Function: Interceptor | |
Author: Casey Smith, Twitter: @subTee | |
License: BSD 3-Clause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Map; | |
public class RomanNumber { | |
static final Map<Character, Integer> ROMAN_NUMERALS; | |
static { | |
HashMap<Character, Integer> m = new HashMap<>(); | |
m.put('I', 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// as long answer to https://twitter.com/pivovarit/status/1067883547669815296 | |
import java.lang.reflect.Field; | |
import java.util.Arrays; | |
class Tuples { | |
public static void main(String... args) throws NoSuchFieldException, IllegalAccessException { | |
new Tuples().exec(); | |
} |
OlderNewer