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
def Link getChain(Single<?> single) { | |
try { | |
val source = single.getClass().getDeclaredField("source") | |
source.setAccessible(true) | |
val sourceInstance = source.get(single) | |
if(sourceInstance instanceof Single) { | |
return new Link(Optional.ofNullable(getChain(sourceInstance)), single.toString()) | |
} else { | |
return new Link(Optional.empty(), single.toString()) | |
} |
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
function map | |
set pars1 (expr $argv[1] - $argv[2]) | |
set pars2 (expr $argv[5] - $argv[4]) | |
set pars3 (expr $argv[3] - $argv[2]) | |
expr (expr (expr $pars1 \* $pars2) / $pars3) + $argv[4] | |
end |
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
function progressbar | |
set WHITE "\e[1;37m" | |
set GREEN "\e[1;32m" | |
set GRAY "\e[0;38;2;100;100;100m" | |
set CLEAR "\e[0m" | |
set gaugeSize (expr $argv[3] - 2) | |
set coloredCharsCount (map $argv[1] 0 $argv[2] 0 $gaugeSize) | |
set coloredChars (seq -s= $coloredCharsCount|tr -d '[:digit:]') | |
set grayCharsCount (expr $gaugeSize - $coloredCharsCount) |
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
#!/bin/bash | |
sudo apt-get --yes --force-yes update | |
sudo apt-get --yes --force-yes install software-properties-common git | |
sudo apt-add-repository --yes --force-yes ppa:fish-shell/release-2 -y | |
sudo apt-get --yes --force-yes update | |
sudo apt-get --yes --force-yes install fish | |
chsh -s /usr/bin/fish | |
echo /usr/bin/fish | sudo tee -a /etc/shells | |
curl -L https://get.oh-my.fish | fish |
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.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import javafx.collections.ObservableList; | |
import javafx.scene.Node; | |
import javafx.scene.chart.Axis; | |
import javafx.scene.chart.LineChart; | |
import javafx.scene.shape.LineTo; | |
import javafx.scene.shape.MoveTo; | |
import javafx.scene.shape.Path; |
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
pragma solidity ^0.5.0; | |
/** | |
* @title SafeMath | |
* @dev Math operations with safety checks that throw on error | |
*/ | |
library SafeMath { | |
/** | |
* @dev Multiplies two numbers, throws on overflow. | |
**/ |
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
private void closeLingeringResources() { //make sure to run this at the end of whatever you're running. It should be part of a cleanup phase. | |
final List<InputStreamDescriptor> streams = new ArrayList<>(); | |
WarningInputStream.retrieveAndClearInputs().forEach(value -> { | |
log.error("A resource was not closed\n" + value.describe()); | |
streams.add(value); | |
}); | |
streams.forEach(value -> { | |
getClosingService().submit(() -> { | |
try { | |
value.getStream().close(); |
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 javafx.animation.KeyFrame | |
import javafx.animation.KeyValue | |
import javafx.animation.Timeline | |
import javafx.event.EventHandler | |
import javafx.geometry.Bounds | |
import javafx.scene.Node | |
import javafx.scene.input.ScrollEvent | |
import javafx.util.Duration | |
class AnimatedZoomOperator { |
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
#!/bin/bash | |
echo "Fixing permissions" | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/authorized_keys | |
FLAVOR=$(cat /etc/*release | grep "^NAME=" | cut -d \" -f2) | |
if [ "$FLAVOR" == "CentOS Linux" ]; then | |
echo "CentOS detected, fixing ACL on ~/.ssh" |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Semantic UI CDN</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css" /> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.js"></script> | |
</head> | |
<body> |