This file contains hidden or 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 project | |
set rootPath "/mnt/c/projects" | |
set project (ls /mnt/c/projects/ | fzf) | |
cd "$rootPath/$project" | |
end |
This file contains hidden or 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 undo-commit | |
git reset --soft HEAD~1 | |
end |
This file contains hidden or 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> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) |
NewerOlder