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
#!/usr/bin/env ruby | |
limit = ARGV[0].to_i | |
result = Array.new(limit) | |
count = 0 | |
STDIN.each_line do |line| | |
if count < limit | |
result[count] = line |
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
public class X | |
{ | |
public static void main(String[] args) | |
throws InterruptedException | |
{ | |
final Thread t = new Thread(new Runnable() { | |
@Override | |
public void run() | |
{ |
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
test |
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
bash_prompt() { | |
local status=$(git status 2> /dev/null | grep 'working directory clean') | |
local dirty='' | |
if [ -z "$status" ]; then | |
local dirty='*' | |
fi | |
local branch=$(git branch 2> /dev/null | grep -e "\* " | sed "s/^..\(.*\)/\1/") | |
if [ -z "$branch" ]; then | |
export PS1="[$(date +%H:%M) \u@\[\033[33m\]\h\[\033[39m\]:\w] " |
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
public class A { | |
private final int dataSize = (int) (Runtime.getRuntime().maxMemory() * 0.6); | |
public void f() | |
{ | |
{ | |
byte[] data = new byte[dataSize]; | |
} | |
byte[] data2 = new byte[dataSize]; |
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
CompilerOracle: print com/facebook/presto/hive/metastore/HiveMetastoreApiStats$1.call | |
CompilerOracle: print com/facebook/presto/hive/RetryDriver.run | |
Compiled method (c1) 286073 33290 ! 3 com.facebook.presto.hive.metastore.HiveMetastoreApiStats$1::call (148 bytes) | |
total in heap [0x00007f345bca5190,0x00007f345bcaa230] = 20640 | |
relocation [0x00007f345bca52b8,0x00007f345bca59b8] = 1792 | |
main code [0x00007f345bca59c0,0x00007f345bca8c80] = 12992 | |
stub code [0x00007f345bca8c80,0x00007f345bca8e60] = 480 | |
oops [0x00007f345bca8e60,0x00007f345bca8e70] = 16 | |
metadata [0x00007f345bca8e70,0x00007f345bca8f10] = 160 | |
scopes data [0x00007f345bca8f10,0x00007f345bca95a0] = 1680 |
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
/* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
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 com.google.inject.Binder; | |
import com.google.inject.Guice; | |
import com.google.inject.Injector; | |
import com.google.inject.Module; | |
import com.google.inject.Scopes; | |
import com.google.inject.multibindings.MapBinder; | |
import javax.inject.Inject; | |
import java.util.Map; |
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
/* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
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
# needs https://github.com/alloy/terminal-notifier | |
# brew install terminal-notifier | |
# to use, source this file or copy the code into your bashrc, | |
# then prefix your commands with "notify". E.g., | |
# | |
# notify mvn clean install | |
# | |
notify() { |